git: 64f5a71c1cb7 - stable/13 - fts: Stop abusing the comma operator.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 08 Apr 2025 10:20:11 UTC
The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=64f5a71c1cb79c09e50a37ddbe958224bb64add4 commit 64f5a71c1cb79c09e50a37ddbe958224bb64add4 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-04-01 13:56:52 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2025-04-08 10:19:41 +0000 fts: Stop abusing the comma operator. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D49624 (cherry picked from commit 5abef29833d32d257a20b61732993987dd2a6056) --- lib/libc/gen/fts.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index ff51d2b224c2..9ffd0bd9972d 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -901,10 +901,12 @@ fts_stat(FTS *sp, FTSENT *p, int follow, int dfd) int saved_errno; const char *path; - if (dfd == -1) - path = p->fts_accpath, dfd = AT_FDCWD; - else + if (dfd == -1) { + path = p->fts_accpath; + dfd = AT_FDCWD; + } else { path = p->fts_name; + } /* If user needs stat info, stat buffer already allocated. */ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;