summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/config.h5
-rw-r--r--utils/utils.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/utils/config.h b/utils/config.h
index adf2db103..a098fb335 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -53,6 +53,11 @@ char *strchrnul(const char *s, int c);
#undef HAVE_UTSNAME
#endif
+#define HAVE_REALPATH
+#if (defined(_WIN32))
+#undef HAVE_REALPATH
+#endif
+
#define HAVE_MKDIR
#if (defined(_WIN32))
#undef HAVE_MKDIR
diff --git a/utils/utils.c b/utils/utils.c
index 346fd5585..c82bc2c74 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -490,3 +490,18 @@ int uname(struct utsname *buf) {
return 0;
}
#endif
+
+#ifndef HAVE_REALPATH
+char *realpath(const char *path, char *resolved_path)
+{
+ char *ret;
+ if (resolved_path == NULL) {
+ ret=strdup(path);
+ } else {
+ ret = resolved_path;
+ strcpy(resolved_path, path);
+ }
+ return ret;
+}
+
+#endif