summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/sh/exec.c8
-rw-r--r--tools/regression/bin/sh/builtins/command12.07
2 files changed, 12 insertions, 3 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c
index 9f8e029..e2dd053 100644
--- a/bin/sh/exec.c
+++ b/bin/sh/exec.c
@@ -672,9 +672,11 @@ typecmd_impl(int argc, char **argv, int cmd, const char *path)
/* Then look at the aliases */
if ((ap = lookupalias(argv[i], 1)) != NULL) {
- if (cmd == TYPECMD_SMALLV)
- out1fmt("alias %s='%s'\n", argv[i], ap->val);
- else
+ if (cmd == TYPECMD_SMALLV) {
+ out1fmt("alias %s=", argv[i]);
+ out1qstr(ap->val);
+ outcslow('\n', out1);
+ } else
out1fmt("%s is an alias for %s\n", argv[i],
ap->val);
continue;
diff --git a/tools/regression/bin/sh/builtins/command12.0 b/tools/regression/bin/sh/builtins/command12.0
new file mode 100644
index 0000000..f981db3
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/command12.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+alias aa=echo\ \'\"\'
+cmd=$(command -v aa)
+alias aa=echo\ bad
+eval "$cmd"
+[ "$(eval aa)" = \" ]
OpenPOWER on IntegriCloud