summaryrefslogtreecommitdiff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-11-02 18:43:19 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-11-02 18:43:19 +0000
commitd8207acddbd1ad5e9339115f7b7bf09820b98c5a (patch)
tree710aa94ec2ee2d06bedd341d0e546d0301af4c03 /Src/glob.c
parentd94e67d6fd182860dca7580edc151315c048f6d7 (diff)
downloadzsh-d8207acddbd1ad5e9339115f7b7bf09820b98c5a.tar.gz
zsh-d8207acddbd1ad5e9339115f7b7bf09820b98c5a.zip
22952: fix some argument delimiters to work with multibyte characters
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 201427bdb..394e91d01 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1243,9 +1243,10 @@ zglob(LinkList list, LinkNode np, int nountok)
else {
/* ... or a user name */
char sav, *tt;
+ int arglen;
/* Find matching delimiters */
- tt = get_strarg(s);
+ tt = get_strarg(s, &arglen);
if (!*tt) {
zerr("missing end of name");
data = 0;
@@ -1255,7 +1256,7 @@ zglob(LinkList list, LinkNode np, int nountok)
sav = *tt;
*tt = '\0';
- if ((pw = getpwnam(s + 1)))
+ if ((pw = getpwnam(s + arglen)))
data = pw->pw_uid;
else {
zerr("unknown user");
@@ -1268,7 +1269,7 @@ zglob(LinkList list, LinkNode np, int nountok)
data = 0;
#endif /* !USE_GETPWNAM */
if (sav)
- s = tt + 1;
+ s = tt + arglen;
else
s = tt;
}
@@ -1283,8 +1284,9 @@ zglob(LinkList list, LinkNode np, int nountok)
else {
/* ...or a delimited group name. */
char sav, *tt;
+ int arglen;
- tt = get_strarg(s);
+ tt = get_strarg(s, &arglen);
if (!*tt) {
zerr("missing end of name");
data = 0;
@@ -1294,7 +1296,7 @@ zglob(LinkList list, LinkNode np, int nountok)
sav = *tt;
*tt = '\0';
- if ((gr = getgrnam(s + 1)))
+ if ((gr = getgrnam(s + arglen)))
data = gr->gr_gid;
else {
zerr("unknown group");
@@ -1307,7 +1309,7 @@ zglob(LinkList list, LinkNode np, int nountok)
data = 0;
#endif /* !USE_GETGRNAM */
if (sav)
- s = tt + 1;
+ s = tt + arglen;
else
s = tt;
}
@@ -1438,8 +1440,7 @@ zglob(LinkList list, LinkNode np, int nountok)
tt = NULL;
}
} else {
- plus = 1;
- tt = get_strarg(s);
+ tt = get_strarg(s, &plus);
if (!*tt)
{
zerr("missing end of string");