]> granicus.if.org Git - graphviz/commitdiff
common: rename 'path' in 'cat_libfile', removing a -Wshadow warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 May 2022 03:12:22 +0000 (20:12 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 23 May 2022 05:00:30 +0000 (22:00 -0700)
lib/common/psusershape.c

index 53a4a91ff4e53a901b38be2f3a1ba90bceec47e2..b232e90aa630eb19ace8de5f389270f2b45f77ed 100644 (file)
@@ -138,7 +138,7 @@ void epsf_free(node_t * n)
 void cat_libfile(GVJ_t * job, const char **arglib, const char **stdlib)
 {
     FILE *fp;
-    const char **s, *bp, *p, *path;
+    const char **s, *bp, *p;
     int i;
     bool use_stdlib = true;
 
@@ -158,17 +158,17 @@ void cat_libfile(GVJ_t * job, const char **arglib, const char **stdlib)
         for (i = 0; (p = arglib[i]) != 0; i++) {
             if (*p == '\0')
                 continue;       /* ignore empty string */
-            path = safefile(p);    /* make sure filename is okay */
-           if (!path) {
+            const char *safepath = safefile(p);    /* make sure filename is okay */
+           if (!safepath) {
                agerr(AGWARN, "can't find library file %s\n", p);
            }
-            else if ((fp = fopen(path, "r"))) {
+            else if ((fp = fopen(safepath, "r"))) {
                 while ((bp = Fgets(fp)))
                     gvputs(job, bp);
                 gvputs(job, "\n"); /* append a newline just in case */
                fclose (fp);
             } else
-                agerr(AGWARN, "can't open library file %s\n", path);
+                agerr(AGWARN, "can't open library file %s\n", safepath);
         }
     }
 }