I installed the attached patch into Gnulib to remove an unnecessary
assignment in fts_safe_changedir.

Jim, could you please check this? My patch does not change behavior, but
I worry that there's a bug in fts_safe_changedir that the unnecessary
assignment was a symptom of. This is code you wrote many years ago, so ...

>From 452fa9db18bc6f3cbcc4095b86edbfe3f825209c Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sun, 17 Mar 2019 12:39:50 -0700
Subject: [PATCH] fts: minor simplification

* lib/fts.c (fts_safe_changedir): Remove redundant assignment.
---
 ChangeLog | 5 +++++
 lib/fts.c | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 9ce4bf24c..28787600f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-17  Paul Eggert  <egg...@cs.ucla.edu>
+
+	fts: minor simplification
+	* lib/fts.c (fts_safe_changedir): Remove redundant assignment.
+
 2019-03-17  Akim Demaille  <a...@lrde.epita.fr>
 
 	bitset, timevar: Depend on c99.
diff --git a/lib/fts.c b/lib/fts.c
index 58232ac97..8b7a4de9c 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -2069,7 +2069,6 @@ fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir)
                 int parent_fd;
                 fd_ring_print (sp, stderr, "pre-pop");
                 parent_fd = i_ring_pop (&sp->fts_fd_ring);
-                is_dotdot = true;
                 if (0 <= parent_fd)
                   {
                     fd = parent_fd;
-- 
2.20.1

Reply via email to