mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 05:24:23 +01:00
20378: Matthias B.: fix bugs joining with metafied chars.
This commit is contained in:
parent
53383c33b8
commit
037485c4a4
@ -1,3 +1,9 @@
|
||||
2004-09-17 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 20378: Matthias B <msb@winterdrache.de>: Src/params.c,
|
||||
Src/utils.c, B02typeset.ztst: Fix bugs with metafied characters
|
||||
in tied arrays.
|
||||
|
||||
2004-09-16 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 20364: Functions/Completer/_oldlist: use $WIDGETSTYLE.
|
||||
|
@ -2643,7 +2643,7 @@ tiedarrsetfn(Param pm, char *x)
|
||||
if (imeta(dptr->joinchar))
|
||||
{
|
||||
sepbuf[0] = Meta;
|
||||
sepbuf[1] = dptr->joinchar;
|
||||
sepbuf[1] = dptr->joinchar ^ 32;
|
||||
sepbuf[2] = '\0';
|
||||
}
|
||||
else
|
||||
|
@ -1912,16 +1912,14 @@ zjoin(char **arr, int delim, int heap)
|
||||
ptr = ret = (heap ? (char *) hcalloc(len) : (char *) zshcalloc(len));
|
||||
for (s = arr; *s; s++) {
|
||||
strucpy(&ptr, *s);
|
||||
if (delim) {
|
||||
if (imeta(delim)) {
|
||||
*ptr++ = Meta;
|
||||
*ptr++ = delim ^ 32;
|
||||
}
|
||||
else
|
||||
*ptr++ = delim;
|
||||
}
|
||||
}
|
||||
ptr[-1] = '\0';
|
||||
ptr[-1 - (imeta(delim) ? 1 : 0)] = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -183,6 +183,21 @@
|
||||
>l o c a l
|
||||
>l:o:c:a l o c a
|
||||
|
||||
typeset -T SCALAR=$'l\x83o\x83c\x83a\x83l' array $'\x83'
|
||||
print $array
|
||||
typeset -U SCALAR
|
||||
print $SCALAR $array
|
||||
0:Tied parameters and uniquified arrays with meta-character as separator
|
||||
>l o c a l
|
||||
>lƒoƒcƒa l o c a
|
||||
|
||||
typeset -T SCALAR=$'l\000o\000c\000a\000l' array $'\000'
|
||||
typeset -U SCALAR
|
||||
print $array
|
||||
[[ $SCALAR == $'l\000o\000c\000a' ]]
|
||||
0:Tied parameters and uniquified arrays with NUL-character as separator
|
||||
>l o c a
|
||||
|
||||
typeset -T SCALAR array
|
||||
typeset +T SCALAR
|
||||
1:Untying is prohibited
|
||||
|
Loading…
Reference in New Issue
Block a user