awk: put at least one NUL between $n. Hopefully closes 337.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
167cd709df
commit
e424423a7b
@ -1571,13 +1571,14 @@ static int awk_split(const char *s, node *spl, char **slist)
|
|||||||
n++; /* we saw yet another delimiter */
|
n++; /* we saw yet another delimiter */
|
||||||
} else {
|
} else {
|
||||||
pmatch[0].rm_eo = l;
|
pmatch[0].rm_eo = l;
|
||||||
if (s[l]) pmatch[0].rm_eo++;
|
if (s[l])
|
||||||
|
pmatch[0].rm_eo++;
|
||||||
}
|
}
|
||||||
memcpy(s1, s, l);
|
memcpy(s1, s, l);
|
||||||
/* make sure we remove *all* of the separator chars */
|
/* make sure we remove *all* of the separator chars */
|
||||||
while (l < pmatch[0].rm_eo) {
|
do {
|
||||||
s1[l++] = '\0';
|
s1[l] = '\0';
|
||||||
}
|
} while (++l < pmatch[0].rm_eo);
|
||||||
nextword(&s1);
|
nextword(&s1);
|
||||||
s += pmatch[0].rm_eo;
|
s += pmatch[0].rm_eo;
|
||||||
} while (*s);
|
} while (*s);
|
||||||
|
Loading…
Reference in New Issue
Block a user