diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-10-07 16:49:50 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-10-07 16:49:50 +0000 |
commit | 1cdaf8c45920e55e438a17052b18480a39eb8fed (patch) | |
tree | 316949c485a17025a9abd16fa7f797e69731fc41 /Src/hist.c | |
parent | 156a28953b82e4ac7027b0fe0eae95e27f28a46f (diff) | |
download | zsh-1cdaf8c45920e55e438a17052b18480a39eb8fed.tar.gz zsh-1cdaf8c45920e55e438a17052b18480a39eb8fed.tar.xz zsh-1cdaf8c45920e55e438a17052b18480a39eb8fed.zip |
28327: fix pseudolexical word splitting with RC_QUOTES
Diffstat (limited to 'Src/hist.c')
-rw-r--r-- | Src/hist.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Src/hist.c b/Src/hist.c index a828f5660..1c626fd76 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2368,15 +2368,6 @@ readhistfile(char *fn, int err, int readflags) if (!strcmp(word, ";")) continue; while (*pt) { - /* - * Oddity 3: "'"s can turn out differently - * if RC_QUOTES is in use. - */ - if (*pt == '\'' && pt > start && - pt[-1] == '\'' && word[-1] == '\'') { - pt++; - continue; - } if (!*word) { bad = 1; break; @@ -2887,12 +2878,18 @@ bufferwords(LinkList list, char *buf, int *index) int num = 0, cur = -1, got = 0, ne = noerrs; int owb = wb, owe = we, oadx = addedx, ozp = zleparse, onc = nocomments; int ona = noaliases, ocs = zlemetacs, oll = zlemetall; - int forloop = 0; + int forloop = 0, rcquotes = opts[RCQUOTES]; char *p, *addedspaceptr; if (!list) list = newlinklist(); + /* + * With RC_QUOTES, 'foo '' bar' comes back as 'foo ' bar'. That's + * not very useful. As nothing in here requires the fully processed + * string expression, we just turn the option off for this function. + */ + opts[RCQUOTES] = 0; zleparse = 1; addedx = 0; noerrs = 1; @@ -3095,6 +3092,7 @@ bufferwords(LinkList list, char *buf, int *index) wb = owb; we = owe; addedx = oadx; + opts[RCQUOTES] = rcquotes; if (index) *index = cur; |