wordexp must set the we_offs entries of we_wordv to null pointers
This commit is contained in:
parent
bef7a85e45
commit
0d5df2df4f
1 changed files with 4 additions and 0 deletions
|
|
@ -139,6 +139,10 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags)
|
||||||
|
|
||||||
we->we_wordv = wv;
|
we->we_wordv = wv;
|
||||||
we->we_wordc = i;
|
we->we_wordc = i;
|
||||||
|
|
||||||
|
for (i=we->we_offs; i; i--)
|
||||||
|
we->we_wordv[i-1] = 0;
|
||||||
|
|
||||||
if (flags & WRDE_DOOFFS) we->we_wordc -= we->we_offs;
|
if (flags & WRDE_DOOFFS) we->we_wordc -= we->we_offs;
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue