Selaa lähdekoodia

dpkg: Reduce variable scope in checkpath

Move them closer to their actual usage.
Guillem Jover 17 vuotta sitten
vanhempi
commit
c61f48738f
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 5 3
      src/help.c

+ 5 - 3
src/help.c

@@ -94,12 +94,10 @@ void checkpath(void) {
     NULL
     NULL
   };
   };
 
 
-  struct stat stab;
   const char *const *prog;
   const char *const *prog;
-  const char *path_list, *path, *path_end;
+  const char *path_list;
   char *filename;
   char *filename;
   int warned= 0;
   int warned= 0;
-  size_t path_len;
 
 
   path_list = getenv("PATH");
   path_list = getenv("PATH");
   if (!path_list)
   if (!path_list)
@@ -107,6 +105,10 @@ void checkpath(void) {
   filename = m_malloc(strlen(path_list) + 2 + strlen("start-stop-daemon"));
   filename = m_malloc(strlen(path_list) + 2 + strlen("start-stop-daemon"));
   
   
   for (prog = prog_list; *prog; prog++) {
   for (prog = prog_list; *prog; prog++) {
+    struct stat stab;
+    const char *path, *path_end;
+    size_t path_len;
+
     path = path_list;
     path = path_list;
     while (path) {
     while (path) {
       path_end = strchr(path, ':');
       path_end = strchr(path, ':');