summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2009-03-22 17:20:42 +0000
committerstefanf <stefanf@FreeBSD.org>2009-03-22 17:20:42 +0000
commit274a24a605b008994ccddf6c8e31f68f785294ee (patch)
tree67b7a2b05dc1a22d61d4f70f923723e2b1f19c82 /bin/sh
parent2756b7d35c20cc9880bd35c181adb2e031790f26 (diff)
downloadFreeBSD-src-274a24a605b008994ccddf6c8e31f68f785294ee.zip
FreeBSD-src-274a24a605b008994ccddf6c8e31f68f785294ee.tar.gz
Make the output of the alias built-in POSIX-compliant: Drop the leading 'alias'
and suppress printing the trailing space which is added for internal purposes.
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/alias.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/sh/alias.c b/bin/sh/alias.c
index a4a4035..6d784f5 100644
--- a/bin/sh/alias.c
+++ b/bin/sh/alias.c
@@ -203,8 +203,13 @@ aliascmd(int argc, char **argv)
for (i = 0; i < ATABSIZE; i++)
for (ap = atab[i]; ap; ap = ap->next) {
if (*ap->name != '\0') {
- out1fmt("alias %s=", ap->name);
+ out1fmt("%s=", ap->name);
+ /* Don't print the space added
+ * above. */
+ v = ap->val + strlen(ap->val) - 1;
+ *v = '\0';
out1qstr(ap->val);
+ *v = ' ';
out1c('\n');
}
}
OpenPOWER on IntegriCloud