Fixed a warning about a label not being used
authorPavel Roskin <proski@gnu.org>
Tue, 22 Aug 2000 15:47:57 +0000 (15:47 -0000)
committerPavel Roskin <proski@gnu.org>
Tue, 22 Aug 2000 15:47:57 +0000 (15:47 -0000)
coreutils/ls.c
ls.c

index 20373eaaa94668adda547e16609dd47f89af0eef..207c617636cb81c48d1077fd0eb1c1e6af6f9249 100644 (file)
@@ -483,8 +483,10 @@ static int list_item(const char *name)
                lstat(fullname, &cur->dstat);   /* get file stat info into node */
                dnp[ni++]= cur;   /* save pointer to node in array */
 #else
-               if (lstat(fullname, &info))
-                       goto direrr;            /* (shouldn't fail) */
+               if (lstat(fullname, &info)) {
+                       closedir(dir);
+                       goto listerr;           /* (shouldn't fail) */
+               }
                list_single(entry->d_name, &info, fullname);
 #endif
        }
@@ -504,8 +506,6 @@ static int list_item(const char *name)
 
        return 0;
 
-  direrr:
-       closedir(dir);
   listerr:
        newline();
        perror(name);
diff --git a/ls.c b/ls.c
index 20373eaaa94668adda547e16609dd47f89af0eef..207c617636cb81c48d1077fd0eb1c1e6af6f9249 100644 (file)
--- a/ls.c
+++ b/ls.c
@@ -483,8 +483,10 @@ static int list_item(const char *name)
                lstat(fullname, &cur->dstat);   /* get file stat info into node */
                dnp[ni++]= cur;   /* save pointer to node in array */
 #else
-               if (lstat(fullname, &info))
-                       goto direrr;            /* (shouldn't fail) */
+               if (lstat(fullname, &info)) {
+                       closedir(dir);
+                       goto listerr;           /* (shouldn't fail) */
+               }
                list_single(entry->d_name, &info, fullname);
 #endif
        }
@@ -504,8 +506,6 @@ static int list_item(const char *name)
 
        return 0;
 
-  direrr:
-       closedir(dir);
   listerr:
        newline();
        perror(name);