summaryrefslogtreecommitdiff
path: root/package/busybox/busybox-1.14.0-awk.patch
blob: ef194eaf8307e9f2a22f9566a3648f637895cc63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- busybox-1.14.0/editors/awk.c	Tue Apr 14 01:43:09 2009
+++ busybox-1.14.0-awk/editors/awk.c	Mon May 18 23:49:29 2009
@@ -1571,13 +1571,14 @@
 				n++; /* we saw yet another delimiter */
 			} else {
 				pmatch[0].rm_eo = l;
-				if (s[l]) pmatch[0].rm_eo++;
+				if (s[l])
+					pmatch[0].rm_eo++;
 			}
 			memcpy(s1, s, l);
 			/* make sure we remove *all* of the separator chars */
-			while (l < pmatch[0].rm_eo) {
-				s1[l++] = '\0';
-			}
+			do {
+				s1[l] = '\0';
+			} while (++l < pmatch[0].rm_eo);
 			nextword(&s1);
 			s += pmatch[0].rm_eo;
 		} while (*s);