Преглед изворни кода

dpkg-deb: Remove redundant debar check and reduce code scope

Guillem Jover пре 15 година
родитељ
комит
291c199001
1 измењених фајлова са 8 додато и 9 уклоњено
  1. 8 9
      dpkg-deb/build.c

+ 8 - 9
dpkg-deb/build.c

@@ -349,16 +349,15 @@ void do_build(const char *const *argv) {
   subdir = false;
   debar = *argv++;
   if (debar != NULL) {
+    struct stat debarstab;
+
     if (*argv) badusage(_("--build takes at most two arguments"));
-    if (debar) {
-      struct stat debarstab;
-
-      if (stat(debar,&debarstab)) {
-        if (errno != ENOENT)
-          ohshite(_("unable to check for existence of archive `%.250s'"),debar);
-      } else if (S_ISDIR(debarstab.st_mode)) {
-        subdir = true;
-      }
+
+    if (stat(debar, &debarstab)) {
+      if (errno != ENOENT)
+        ohshite(_("unable to check for existence of archive `%.250s'"), debar);
+    } else if (S_ISDIR(debarstab.st_mode)) {
+      subdir = true;
     }
   } else {
     char *m;