mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Reset path name back to original correctly in fts_build() when
FTS_NOCHDIR option is used. fts_build() could strip a trailing slash from path name in post-order visit if a path pointing to an empty directory was given for fts_open(). PR: bin/133907, kern/134513 Reviewed by: das Approved by: trasz (mentor) MFC after: 1 month
This commit is contained in:
parent
8d6956fb6b
commit
909e260153
1 changed files with 2 additions and 5 deletions
|
|
@ -842,11 +842,8 @@ mem1: saved_errno = errno;
|
|||
* If not changing directories, reset the path back to original
|
||||
* state.
|
||||
*/
|
||||
if (ISSET(FTS_NOCHDIR)) {
|
||||
if (len == sp->fts_pathlen || nitems == 0)
|
||||
--cp;
|
||||
*cp = '\0';
|
||||
}
|
||||
if (ISSET(FTS_NOCHDIR))
|
||||
sp->fts_path[cur->fts_pathlen] = '\0';
|
||||
|
||||
/*
|
||||
* If descended after called from fts_children or after called from
|
||||
|
|
|
|||
Loading…
Reference in a new issue