summaryrefslogtreecommitdiff
path: root/lib/replace/replace.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-05 22:45:27 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-05 23:07:32 +1100
commitf3c738f8193665a80835471f6754a66b20725afa (patch)
tree75342ddb7379f317a72d46a4e9f19894ff89f0d6 /lib/replace/replace.c
parentace6d75ae6f953b76fa9709857af4744020cd6fb (diff)
downloadsamba-f3c738f8193665a80835471f6754a66b20725afa.tar.gz
samba-f3c738f8193665a80835471f6754a66b20725afa.tar.bz2
samba-f3c738f8193665a80835471f6754a66b20725afa.zip
replace: added get_current_dir_name()
Diffstat (limited to 'lib/replace/replace.c')
-rw-r--r--lib/replace/replace.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 8eba98acf4..f2dcb10ddc 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -735,3 +735,15 @@ int dprintf(int fd, const char *format, ...)
}
#endif
+#ifndef HAVE_GET_CURRENT_DIR_NAME
+char *rep_get_current_dir_name(void)
+{
+ char buf[PATH_MAX+1];
+ char *p;
+ p = getcwd(buf, sizeof(buf));
+ if (p == NULL) {
+ return NULL;
+ }
+ return strdup(p);
+}
+#endif