diff options
author | 2017-12-27 13:02:57 +0000 | |
---|---|---|
committer | 2017-12-27 13:02:57 +0000 | |
commit | 201e0776e68df3547d24a3790d166bbefd438756 (patch) | |
tree | 6641963dd6823f21f53451d5686cd4996555f12a /bin/ksh/var.c | |
parent | Implement OF_getpropint64(). (diff) | |
download | wireguard-openbsd-201e0776e68df3547d24a3790d166bbefd438756.tar.xz wireguard-openbsd-201e0776e68df3547d24a3790d166bbefd438756.zip |
Add -Wshadow to Makefile and fix the resulting warnings. Many of
the warnings are due to the use of globals with generic names,
specifically "options" and "path". I've renamed "options" to
"sh_options" since it holds the shell options and "path" to
"search_path". OK jca@ tb@
Diffstat (limited to 'bin/ksh/var.c')
-rw-r--r-- | bin/ksh/var.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/ksh/var.c b/bin/ksh/var.c index 16805460d87..73d894897ff 100644 --- a/bin/ksh/var.c +++ b/bin/ksh/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.59 2017/08/30 17:08:45 jca Exp $ */ +/* $OpenBSD: var.c,v 1.60 2017/12/27 13:02:57 millert Exp $ */ #include <sys/stat.h> @@ -525,11 +525,11 @@ formatstr(struct tbl *vp, const char *s) int slen; if (vp->flag & RJUST) { - const char *q = s + olen; - /* strip trailing spaces (at&t ksh uses q[-1] == ' ') */ - while (q > s && isspace((unsigned char)q[-1])) - --q; - slen = q - s; + const char *r = s + olen; + /* strip trailing spaces (at&t ksh uses r[-1] == ' ') */ + while (r > s && isspace((unsigned char)r[-1])) + --r; + slen = r - s; if (slen > vp->u2.field) { s += slen - vp->u2.field; slen = vp->u2.field; @@ -960,8 +960,8 @@ setspec(struct tbl *vp) switch (special(vp->name)) { case V_PATH: - afree(path, APERM); - path = str_save(str_val(vp), APERM); + afree(search_path, APERM); + search_path = str_save(str_val(vp), APERM); flushcom(1); /* clear tracked aliases */ break; case V_IFS: @@ -1067,8 +1067,8 @@ unsetspec(struct tbl *vp) { switch (special(vp->name)) { case V_PATH: - afree(path, APERM); - path = str_save(def_path, APERM); + afree(search_path, APERM); + search_path = str_save(def_path, APERM); flushcom(1); /* clear tracked aliases */ break; case V_IFS: |