From c81ba09d8f3a44570267e96801584adf298fb9e3 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 17 Aug 2009 21:06:03 +0000 Subject: 27218: don't unquote $line generated in comparguments for _arguments --- ChangeLog | 8 +++++++- Src/Zle/computil.c | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index be6bd9822..c5cc4d20c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-17 Peter Stephenson + + * 27218: Src/Zle/computil.c: don't unquote command line + to generate "line" in _arguments since the caller can't + tell what was there before. + 2009-08-17 Peter Stephenson * 27217: Functions/Newuser/zsh-newuser-install: fix typo @@ -12085,5 +12091,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4761 $ +* $Revision: 1.4762 $ ***************************************************** diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index f323574ee..f2837ed93 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -1866,9 +1866,12 @@ ca_parse_line(Cadef d, int multi, int first) Caopt ptr, wasopt = NULL, dopt; struct castate state; char *line, *oline, *pe, **argxor = NULL; - int cur, doff, argend, arglast, ne; + int cur, doff, argend, arglast; Patprog endpat = NULL, napat = NULL; LinkList sopts = NULL; +#if 0 + int ne; +#endif /* Free old state. */ @@ -1927,13 +1930,24 @@ ca_parse_line(Cadef d, int multi, int first) dopt = NULL; doff = state.singles = arglast = 0; - /* remove quotes */ oline = line; +#if 0 + /* + * remove quotes. + * This is commented out: it doesn't allow you to discriminate + * between command line values that can be expanded and those + * that can't, and in some cases this generates inconsistency; + * for example, ~/foo\[bar unqotes to ~/foo[bar which doesn't + * work either way---it's wrong if the ~ is quoted, and + * wrong if the [ isn't quoted.. So it's now up to the caller to + * unquote. + */ line = dupstring(line); ne = noerrs; noerrs = 2; parse_subst_string(line); noerrs = ne; +#endif remnulargs(line); untokenize(line); -- cgit 1.4.1