mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-10 06:48:03 +02:00
51278: make (i) subscript flag for zero-length string consistent
This commit is contained in:
parent
857bc4343b
commit
03292bceec
3 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2023-01-16 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* 51278: Src/params.c, Test/D06subscript.ztst: result of (i)
|
||||||
|
subscript flag with zero-length string was inconsistent with
|
||||||
|
other cases.
|
||||||
|
|
||||||
2023-01-11 Oliver Kiddle <opk@zsh.org>
|
2023-01-11 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
* 51297: Test/X04zlehighlight.ztst: update expected test results
|
* 51297: Test/X04zlehighlight.ztst: update expected test results
|
||||||
|
|
|
@ -1669,7 +1669,7 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
|
||||||
/* Searching characters */
|
/* Searching characters */
|
||||||
int slen;
|
int slen;
|
||||||
d = getstrvalue(v);
|
d = getstrvalue(v);
|
||||||
if (!d || !*d)
|
if (!d)
|
||||||
return 0;
|
return 0;
|
||||||
/*
|
/*
|
||||||
* beg and len are character counts, not raw offsets.
|
* beg and len are character counts, not raw offsets.
|
||||||
|
|
|
@ -299,3 +299,12 @@ F:In math, (($i)) should be the same as ((i)), see workers/47748.
|
||||||
echo ${string[(pws:\0:)1]}
|
echo ${string[(pws:\0:)1]}
|
||||||
0:Word splitting by NUL
|
0:Word splitting by NUL
|
||||||
>foo
|
>foo
|
||||||
|
|
||||||
|
string="a"
|
||||||
|
print ${string[(i)x]}
|
||||||
|
string=""
|
||||||
|
print ${string[(i)x]}
|
||||||
|
0:Can check off end of zero length string
|
||||||
|
F:Regression test for inconsistency of failed (i) on zero-length string
|
||||||
|
>2
|
||||||
|
>1
|
||||||
|
|
Loading…
Reference in a new issue