summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2010-10-09 17:11:28 +0000
committerVincent Sanders <vince@netsurf-browser.org>2010-10-09 17:11:28 +0000
commit4d6534622e55bee459837893cb8d7eab40d6168c (patch)
tree972937e0e0207871fc67d3a4f1923d1f685015ab
parent66d6bbc06b896c43ba9b5e8b5936658af1d01c5e (diff)
downloadnetsurf-4d6534622e55bee459837893cb8d7eab40d6168c.tar.gz
netsurf-4d6534622e55bee459837893cb8d7eab40d6168c.tar.bz2
add realpath compatability for windows
svn path=/trunk/netsurf/; revision=10873
-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