mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 05:00:59 +01:00
23696: x=x; x[-10]=y did bad things
This commit is contained in:
parent
9084df4dc3
commit
4fab17e62a
3 changed files with 27 additions and 1 deletions
|
|
@ -2076,8 +2076,11 @@ setstrvalue(Value v, char *val)
|
|||
}
|
||||
if (v->start > zlen)
|
||||
v->start = zlen;
|
||||
if (v->end < 0)
|
||||
if (v->end < 0) {
|
||||
v->end += zlen + 1;
|
||||
if (v->end < 0)
|
||||
v->end = 0;
|
||||
}
|
||||
else if (v->end > zlen)
|
||||
v->end = zlen;
|
||||
x = (char *) zalloc(v->start + strlen(val) + zlen - v->end + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue