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.
This commit is contained in:
Stefan Farfeleder 2009-03-22 17:20:42 +00:00
parent 2989a67790
commit 0de913c328
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190270

View File

@ -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');
}
}