diff options
author | Denis Vlasenko | 2009-04-12 13:54:13 +0000 |
---|---|---|
committer | Denis Vlasenko | 2009-04-12 13:54:13 +0000 |
commit | 67b5eeb93324f7484836be705698e72008498fe5 (patch) | |
tree | 146cb9dc174befb20d6a0d75f88bf3cef9cc82ee /editors/awk.c | |
parent | 32a385f5b0a74ca886e69472aaa1de8045a1ddbd (diff) | |
download | busybox-67b5eeb93324f7484836be705698e72008498fe5.zip busybox-67b5eeb93324f7484836be705698e72008498fe5.tar.gz |
awk: fix long field separators case. By Ian Wienand (ianw AT vmware.com)
Diffstat (limited to 'editors/awk.c')
-rw-r--r-- | editors/awk.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c index 9b15b3c..89ce2cf 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -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); |