summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-08-05 01:30:19 +0000
committerClint Adams <clint@users.sourceforge.net>2000-08-05 01:30:19 +0000
commit45ffc3b6c8e5cca800a0ed55bbf9b1bb1c362b00 (patch)
treec2d3a457cbe267ea4e9c5263ce0699570328e2f6
parent971f7c0a19eefebe90274fde29c33e3a3a04b552 (diff)
downloadzsh-45ffc3b6c8e5cca800a0ed55bbf9b1bb1c362b00.tar.gz
zsh-45ffc3b6c8e5cca800a0ed55bbf9b1bb1c362b00.tar.xz
zsh-45ffc3b6c8e5cca800a0ed55bbf9b1bb1c362b00.zip
12541: zrealpath wrapper around realpath()
-rw-r--r--ChangeLog3
-rw-r--r--Src/compat.c13
-rw-r--r--configure.in2
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 39e71f5d4..07484aabc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-08-04  Clint Adams  <schizo@debian.org>
 
+	* 12541: configure.in, Src/compat.c: zrealpath wrapper around
+	realpath().
+
 	* 12533: Src/Modules/files.c: drop the tail of the path
 	passed to mkdir in the call to pathconf().
 
diff --git a/Src/compat.c b/Src/compat.c
index 2f6628f33..27c9c740c 100644
--- a/Src/compat.c
+++ b/Src/compat.c
@@ -141,6 +141,19 @@ zpathmax(char *dir)
 }
 #endif
 
+/**/
+mod_export char *
+zrealpath(const char *path, char *resolved_path)
+{
+#ifdef HAVE_REALPATH
+    return realpath(path, resolved_path);
+#else /* the following block should be replaced with a realpath() equiv. */
+    long pathmax;
+
+    if ((pathmax = zpathmax(path)) > 0)
+	return strncpy(resolved_path, path, pathmax);
+#endif
+}
 
 /**/
 mod_export char *
diff --git a/configure.in b/configure.in
index 6f813e0b0..8bd3ab408 100644
--- a/configure.in
+++ b/configure.in
@@ -864,7 +864,7 @@ AC_CHECK_FUNCS(strftime difftime gettimeofday \
 	       signgam \
 	       putenv getenv \
 	       brk sbrk \
-	       pathconf)
+	       pathconf realpath)
 AC_FUNC_STRCOLL
 
 if test $ac_cv_func_setpgrp = yes; then