awk: fix long field separators case. By Ian Wienand (ianw AT vmware.com)

This commit is contained in:
Denis Vlasenko
2009-04-12 13:54:13 +00:00
parent 32a385f5b0
commit 67b5eeb933
2 changed files with 10 additions and 1 deletions

View File

@ -1574,7 +1574,10 @@ static int awk_split(const char *s, node *spl, char **slist)
if (s[l]) pmatch[0].rm_eo++;
}
memcpy(s1, s, l);
s1[l] = '\0';
/* make sure we remove *all* of the separator chars */
while (l < pmatch[0].rm_eo) {
s1[l++] = '\0';
}
nextword(&s1);
s += pmatch[0].rm_eo;
} while (*s);