summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-06 04:02:50 +0000
committertjr <tjr@FreeBSD.org>2002-06-06 04:02:50 +0000
commit70c6f806e018ebe56f21969bc9ef2b2a79b6fa21 (patch)
treee1822e7c77fb68e4b1d49301cd28cc549c5433f1 /bin
parentc74ee6d523a54949196b04673647cbd7ce5c4f01 (diff)
downloadFreeBSD-src-70c6f806e018ebe56f21969bc9ef2b2a79b6fa21.zip
FreeBSD-src-70c6f806e018ebe56f21969bc9ef2b2a79b6fa21.tar.gz
Quote the output of the no-argument form of the `set' builtin for re-input
to the shell.
Diffstat (limited to 'bin')
-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 0af1eeb..8a3abb7 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;
OpenPOWER on IntegriCloud