mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
Unbreak support for systems that have no limit on pathname length.
Noticed by: bde
This commit is contained in:
parent
495bedfbd0
commit
ea87e79d5f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107888
|
@ -157,10 +157,8 @@ check(const char *path)
|
|||
pathmax = PATH_MAX;
|
||||
} else
|
||||
pathmax = _POSIX_PATH_MAX;
|
||||
/* PATH_MAX includes space for the trailing null byte. */
|
||||
pathmax--;
|
||||
if (pathmax != -1 && strlen(path) > (size_t)pathmax) {
|
||||
warnx("%s: path too long (limit %ld)", path, pathmax);
|
||||
if (pathmax != -1 && strlen(path) >= (size_t)pathmax) {
|
||||
warnx("%s: path too long (limit %ld)", path, pathmax - 1);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue