mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
28339: backslash-newline history without HIST_LEX_WORDS
28340: assignment to range of scalar variable with multibyte characters
This commit is contained in:
parent
6fea7f0d3c
commit
af5a85f363
4 changed files with 50 additions and 7 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,6 +1,12 @@
|
|||
2010-10-10 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 28332: Src/hist.c: HIST_LEX_WORDS didn't handled
|
||||
* 28340: Src/params.c: assignment with negative index didn't
|
||||
work with multibyte characters.
|
||||
|
||||
* 28339: Src/hist.c: NO_HIST_LEX_WORDS didn't handle
|
||||
backslash-newline line continuation properly, either.
|
||||
|
||||
* 28332: Src/hist.c: HIST_LEX_WORDS didn't handle
|
||||
backslash-newline line continuation properly. Come to think of
|
||||
it, neither does the alternative.
|
||||
|
||||
|
@ -13728,5 +13734,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5101 $
|
||||
* $Revision: 1.5102 $
|
||||
*****************************************************
|
||||
|
|
12
Src/hist.c
12
Src/hist.c
|
@ -2365,7 +2365,7 @@ readhistfile(char *fn, int err, int readflags)
|
|||
*/
|
||||
if (inblank(*pt))
|
||||
pt++;
|
||||
else if (strpfx("\\\n", pt))
|
||||
else if (pt[0] == '\\' && pt[1] == '\n')
|
||||
pt += 2;
|
||||
else
|
||||
break;
|
||||
|
@ -2414,8 +2414,14 @@ readhistfile(char *fn, int err, int readflags)
|
|||
}
|
||||
if (!uselex) {
|
||||
do {
|
||||
while (inblank(*pt))
|
||||
pt++;
|
||||
for (;;) {
|
||||
if (inblank(*pt))
|
||||
pt++;
|
||||
else if (pt[0] == '\\' && pt[1] == '\n')
|
||||
pt += 2;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (*pt) {
|
||||
if (nwordpos >= nwords)
|
||||
words = (short *)
|
||||
|
|
17
Src/params.c
17
Src/params.c
|
@ -2275,9 +2275,22 @@ setstrvalue(Value v, char *val)
|
|||
if (v->start > zlen)
|
||||
v->start = zlen;
|
||||
if (v->end < 0) {
|
||||
v->end += zlen + 1;
|
||||
if (v->end < 0)
|
||||
v->end += zlen;
|
||||
if (v->end < 0) {
|
||||
v->end = 0;
|
||||
} else if (v->end >= zlen) {
|
||||
v->end = zlen;
|
||||
} else {
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
if (isset(MULTIBYTE)) {
|
||||
v->end += MB_METACHARLEN(z + v->end);
|
||||
} else {
|
||||
v->end++;
|
||||
}
|
||||
#else
|
||||
v->end++;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (v->end > zlen)
|
||||
v->end = zlen;
|
||||
|
|
|
@ -447,3 +447,21 @@
|
|||
print $(( [#16] #REPLY ))
|
||||
0:read passes through invalid multibyte characters
|
||||
>0xC5
|
||||
|
||||
word=abcま
|
||||
word[-1]=
|
||||
print $word
|
||||
word=abcま
|
||||
word[-2]=
|
||||
print $word
|
||||
word=abcま
|
||||
word[4]=d
|
||||
print $word
|
||||
word=abcま
|
||||
word[3]=not_c
|
||||
print $word
|
||||
0:assignment with negative indices
|
||||
>abc
|
||||
>abま
|
||||
>abcd
|
||||
>abnot_cま
|
||||
|
|
Loading…
Reference in a new issue