From 974d2b64c63b361b36bae10ba4cbc41dd259f547 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 20 May 2022 20:12:22 -0700 Subject: [PATCH] common: rename 'path' in 'cat_libfile', removing a -Wshadow warning --- lib/common/psusershape.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/common/psusershape.c b/lib/common/psusershape.c index 53a4a91ff..b232e90aa 100644 --- a/lib/common/psusershape.c +++ b/lib/common/psusershape.c @@ -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); } } } -- 2.40.0