Do not consider using -C arg "as is" for .CURDIR unless it starts with /.

Reported by:    bdrewery
This commit is contained in:
Simon J. Gerraty 2017-03-11 20:28:31 +00:00
parent 277681e109
commit a3b2e0bc8b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315088

View file

@ -458,7 +458,8 @@ MainParseArgs(int argc, char **argv)
(void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
exit(2);
}
if (stat(argvalue, &sa) != -1 &&
if (argvalue[0] == '/' &&
stat(argvalue, &sa) != -1 &&
stat(curdir, &sb) != -1 &&
sa.st_ino == sb.st_ino &&
sa.st_dev == sb.st_dev)