X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmisc%2Fwordexp.c;h=4a3efc7bc40a83d055bb1f4d952e6b70b2d4893c;hp=4609b99f624c0926d8ce054230562f8080863214;hb=28af39fe427ffec8b836f4f30450ffc30b03e5c4;hpb=145c05345d6172eef1c8c274d696dbe1c01b88ab diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c index 4609b99f..4a3efc7b 100644 --- a/src/misc/wordexp.c +++ b/src/misc/wordexp.c @@ -136,7 +136,8 @@ static int do_wordexp(const char *s, wordexp_t *we, int flags) } we->we_wordv = wv; - we->we_wordc = i - we->we_offs; + we->we_wordc = i; + if (flags & WRDE_DOOFFS) we->we_wordc -= we->we_offs; return err; }