diff options
author | Paul Smith <psmith@gnu.org> | 2012-09-09 23:14:55 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2012-09-09 23:14:55 +0000 |
commit | b9c4a38022e5238356957bba6c2ffaef7a219a23 (patch) | |
tree | ab1f7e2572889d5913ebda516c924071981ca40d /function.c | |
parent | 90ee335724c3165ae31bfc45486a1c185d85a19c (diff) | |
download | gunmake-b9c4a38022e5238356957bba6c2ffaef7a219a23.tar.gz |
On BSD, realpath(3) doesn't fail if the target doesn't exist, so test
explicitly with stat(2). Fixes Savannah bug #35919.
Diffstat (limited to 'function.c')
-rw-r--r-- | function.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -2066,9 +2066,7 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED) const char *path = 0; int doneany = 0; unsigned int len = 0; -#ifndef HAVE_REALPATH struct stat st; -#endif PATH_VAR (in); PATH_VAR (out); @@ -2083,9 +2081,9 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED) #ifdef HAVE_REALPATH realpath (in, out) #else - abspath (in, out) && stat (out, &st) == 0 + abspath (in, out) #endif - ) + && stat (out, &st) == 0) { o = variable_buffer_output (o, out, strlen (out)); o = variable_buffer_output (o, " ", 1); |