[PATCH RESEND] alias: printalias: quote the name, too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This ensures even something like
  alias 'a|b|c=d'
is output by alias as
  'a|b|c'='d'
instead of
  a|b|c='d'
which is both "suitable for reinput to the shell" per POSIX
and doesn't execute the aliases as code.
---
 src/alias.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/alias.c b/src/alias.c
index daeacbb..1375cdd 100644
--- a/src/alias.c
+++ b/src/alias.c
@@ -197,7 +197,7 @@ freealias(struct alias *ap) {
 
 void
 printalias(const struct alias *ap) {
-	out1fmt("%s=%s\n", ap->name, single_quote(ap->val));
+	out1fmt("%s=%s\n", single_quote(ap->name), single_quote(ap->val));
 }
 
 STATIC struct alias **
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux