git: 9c84aea41433 - stable/14 - fts: Stop abusing the comma operator.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 08 Apr 2025 10:20:10 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=9c84aea41433505d610c6e2eb84c99fcd895a99f
commit 9c84aea41433505d610c6e2eb84c99fcd895a99f
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:43 +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 64828ff73d60..5c4beef6f573 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;