diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2006-11-05 21:49:15 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2006-11-05 21:49:15 +0000 |
commit | a519a6d15ccbb429a112ed7b8f4594a51948629d (patch) | |
tree | ee4210983075cba88de8f38d46c0a797a933120b /Src/builtin.c | |
parent | ebc76673aaa9a4f1017a67ae65a1acee10f6bb42 (diff) | |
download | zsh-a519a6d15ccbb429a112ed7b8f4594a51948629d.tar.gz zsh-a519a6d15ccbb429a112ed7b8f4594a51948629d.tar.xz zsh-a519a6d15ccbb429a112ed7b8f4594a51948629d.zip |
22968: fix metafication for print -z and print -s
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index 185365644..e4ca9b3d9 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -3454,6 +3454,14 @@ mod_export LinkList bufstack; else \ count += fprintf(fout, spec, width, VAL); +/* + * Because of the use of getkeystring() to interpret the arguments, + * the elements of args spend a large part of the function unmetafied + * with the lengths in len. This may have seemed a good idea once. + * As we are stuck with this for now, we need to be very careful + * deciding what state args is in. + */ + /**/ int bin_print(char *name, char **args, Options ops, int func) @@ -3727,6 +3735,14 @@ bin_print(char *name, char **args, Options ops, int func) /* normal output */ if (!fmt) { + if (OPT_ISSET(ops, 'z') || OPT_ISSET(ops, 's')) { + /* + * We don't want the arguments unmetafied after all. + */ + for (n = 0; n < argc; n++) + metafy(args[n], len[n], META_NOALLOC); + } + /* -z option -- push the arguments onto the editing buffer stack */ if (OPT_ISSET(ops,'z')) { queue_signals(); |