aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/var.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-06-06 04:02:50 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-06-06 04:02:50 +0000
commit592588448e7dddeef57414fab6a9ae6b6bac02ff (patch)
treee1822e7c77fb68e4b1d49301cd28cc549c5433f1 /bin/sh/var.c
parent45086f8cf6fa6058c4e8bf57182fca61278d891b (diff)
downloadsrc-592588448e7dddeef57414fab6a9ae6b6bac02ff.tar.gz
src-592588448e7dddeef57414fab6a9ae6b6bac02ff.zip
Notes
Diffstat (limited to 'bin/sh/var.c')
-rw-r--r--bin/sh/var.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c
index 0af1eebb45fa..8a3abb7dbf51 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -508,11 +508,17 @@ showvarscmd(int argc __unused, char **argv __unused)
{
struct var **vpp;
struct var *vp;
+ const char *s;
for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) {
for (vp = *vpp ; vp ; vp = vp->next) {
- if ((vp->flags & VUNSET) == 0)
- out1fmt("%s\n", vp->text);
+ if (vp->flags & VUNSET)
+ continue;
+ for (s = vp->text; *s != '='; s++)
+ out1c(*s);
+ out1c('=');
+ out1qstr(s + 1);
+ out1c('\n');
}
}
return 0;