diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-01-13 00:57:55 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-01-13 01:25:46 +0000 |
commit | a8a00be442370ce491f9cc22a3fa0b4853feecb5 (patch) | |
tree | 798f6798171815349898ecc8811b57c6345b8295 /Src/hashtable.c | |
parent | 152875ba03797e788397be7a3af6c09391dce9f0 (diff) | |
download | zsh-a8a00be442370ce491f9cc22a3fa0b4853feecb5.tar.gz zsh-a8a00be442370ce491f9cc22a3fa0b4853feecb5.tar.xz zsh-a8a00be442370ce491f9cc22a3fa0b4853feecb5.zip |
37591: 'alias -L': skip with a warning aliases with '=' in their LHS
Diffstat (limited to 'Src/hashtable.c')
-rw-r--r-- | Src/hashtable.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c index 2d1ff87cb..0664c3694 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -1276,6 +1276,15 @@ printaliasnode(HashNode hn, int printflags) } if (printflags & PRINT_LIST) { + /* Fast fail on unrepresentable values. */ + if (strchr(a->node.nam, '=')) { + zwarn("invalid alias '%s' encountered while printing aliases", + a->node.nam); + /* ### TODO: Return an error status to the C caller */ + return; + } + + /* Normal path. */ printf("alias "); if (a->node.flags & ALIAS_SUFFIX) printf("-s "); |