]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: stdbuf: move a declaration; no-semantic-change
authorJim Meyering <meyering@redhat.com>
Sun, 30 Aug 2009 20:29:19 +0000 (22:29 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 30 Aug 2009 20:34:06 +0000 (22:34 +0200)
* src/stdbuf.c (set_program_path): Move a declaration down into
the scope where it's used.

src/stdbuf.c

index 007cc21946ff11a95e79e4c7075d663999ed94e2..38a531375f00f361ceff66051dfdb8bd83fea849 100644 (file)
@@ -145,7 +145,6 @@ set_program_path (const char *arg)
     }
   else
     {
-      char *path;
       char tmppath[PATH_MAX + 1];
       ssize_t len = readlink ("/proc/self/exe", tmppath, sizeof (tmppath) - 1);
       if (len > 0)
@@ -156,7 +155,7 @@ set_program_path (const char *arg)
       else if ((path = getenv ("PATH")))
         {
           char *dir;
-          path = xstrdup (path);
+          char *path = xstrdup (path);
           for (dir = strtok (path, ":"); dir != NULL; dir = strtok (NULL, ":"))
             {
               int req = snprintf (tmppath, sizeof (tmppath), "%s/%s", dir, arg);