mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-31 03:25:08 +00:00
On BSD, realpath(3) doesn't fail if the target doesn't exist, so test
explicitly with stat(2). Fixes Savannah bug #35919.
This commit is contained in:
parent
90ee335724
commit
b9c4a38022
2 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
||||||
2012-09-09 Paul Smith <psmith@gnu.org>
|
2012-09-09 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* function.c (func_realpath): BSD realpath(3) doesn't fail if the
|
||||||
|
file does not exist: use stat. Fixes Savannah bug #35919.
|
||||||
|
|
||||||
* file.c (expand_deps): Duplicate the current variable buffer, not
|
* file.c (expand_deps): Duplicate the current variable buffer, not
|
||||||
the old pointer. Fixes Savannah bug #36925.
|
the old pointer. Fixes Savannah bug #36925.
|
||||||
|
|
||||||
|
|
|
@ -2066,9 +2066,7 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED)
|
||||||
const char *path = 0;
|
const char *path = 0;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
unsigned int len = 0;
|
unsigned int len = 0;
|
||||||
#ifndef HAVE_REALPATH
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
#endif
|
|
||||||
PATH_VAR (in);
|
PATH_VAR (in);
|
||||||
PATH_VAR (out);
|
PATH_VAR (out);
|
||||||
|
|
||||||
|
@ -2083,9 +2081,9 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED)
|
||||||
#ifdef HAVE_REALPATH
|
#ifdef HAVE_REALPATH
|
||||||
realpath (in, out)
|
realpath (in, out)
|
||||||
#else
|
#else
|
||||||
abspath (in, out) && stat (out, &st) == 0
|
abspath (in, out)
|
||||||
#endif
|
#endif
|
||||||
)
|
&& stat (out, &st) == 0)
|
||||||
{
|
{
|
||||||
o = variable_buffer_output (o, out, strlen (out));
|
o = variable_buffer_output (o, out, strlen (out));
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
|
|
Loading…
Reference in a new issue