summary refs log tree commit diff
path: root/io/ftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/ftw.c')
-rw-r--r--io/ftw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io/ftw.c b/io/ftw.c
index 227f3f3b52..3d2d940cd8 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -629,13 +629,13 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
   data.known_objects = NULL;
 
   /* Now go to the directory containing the initial file/directory.  */
-  if ((flags & FTW_CHDIR) && data.ftw.base > 0)
+  if (flags & FTW_CHDIR)
     {
       /* GNU extension ahead.  */
       cwd =  __getcwd (NULL, 0);
       if (cwd == NULL)
 	result = -1;
-      else
+      else if (data.ftw.base > 0)
 	{
 	  /* Change to the directory the file is in.  In data.dirbuf
 	     we have a writable copy of the file name.  Just NUL