summaryrefslogtreecommitdiff
path: root/lib/replace/replace.c
diff options
context:
space:
mode:
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