diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/awk.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/editors/awk.c b/editors/awk.c index 89ce2cfc8..89ae503aa 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -1571,13 +1571,14 @@ static int awk_split(const char *s, node *spl, char **slist) | |||
1571 | n++; /* we saw yet another delimiter */ | 1571 | n++; /* we saw yet another delimiter */ |
1572 | } else { | 1572 | } else { |
1573 | pmatch[0].rm_eo = l; | 1573 | pmatch[0].rm_eo = l; |
1574 | if (s[l]) pmatch[0].rm_eo++; | 1574 | if (s[l]) |
1575 | pmatch[0].rm_eo++; | ||
1575 | } | 1576 | } |
1576 | memcpy(s1, s, l); | 1577 | memcpy(s1, s, l); |
1577 | /* make sure we remove *all* of the separator chars */ | 1578 | /* make sure we remove *all* of the separator chars */ |
1578 | while (l < pmatch[0].rm_eo) { | 1579 | do { |
1579 | s1[l++] = '\0'; | 1580 | s1[l] = '\0'; |
1580 | } | 1581 | } while (++l < pmatch[0].rm_eo); |
1581 | nextword(&s1); | 1582 | nextword(&s1); |
1582 | s += pmatch[0].rm_eo; | 1583 | s += pmatch[0].rm_eo; |
1583 | } while (*s); | 1584 | } while (*s); |