glob: Declare variables at the very start of their scope.
authorBenno Schulenberg <bensberg@telfort.nl>
Sat, 1 Jul 2017 16:05:00 +0000 (18:05 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 2 Jul 2017 14:36:46 +0000 (16:36 +0200)
* lib/glob.c (convert_dirent, convert_dirent64): Give each fragment
its separate scope, so the functions will compile on Haiku.

ChangeLog
lib/glob.c

index c10c2c328da70fed14ce5440e1daebca581e87bd..abd5ebd31e7ab1d5452c638ce28bb20d1d5e4e00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-01  Benno Schulenberg  <bensberg@telfort.nl>
+
+       glob: Declare variables at the very start of their scope.
+       * lib/glob.c (convert_dirent, convert_dirent64): Give each fragment
+       its separate scope, so the functions will compile on Haiku.
+
 2017-07-01  Bruno Haible  <bruno@clisp.org>
 
        logbl: Work around a glibc bug on PowerPC64LE.
index d4fdc1737b84da476d924bb4063601305c6d058d..dc0aff693e1f96204bb2102b428c42332b7686cd 100644 (file)
@@ -189,8 +189,11 @@ convert_dirent (const struct dirent *source)
       struct readdir_result result = { NULL, };
       return result;
     }
-  struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
-  return result;
+  else
+    {
+      struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
+      return result;
+    }
 }
 
 #ifndef COMPILE_GLOB64
@@ -204,8 +207,11 @@ convert_dirent64 (const struct dirent64 *source)
       struct readdir_result result = { NULL, };
       return result;
     }
-  struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
-  return result;
+  else
+    {
+      struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
+      return result;
+    }
 }
 #endif