aboutsummaryrefslogtreecommitdiff
path: root/sed.c
diff options
context:
space:
mode:
authormarkw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-20 23:27:17 +0000
committermarkw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-04-20 23:27:17 +0000
commitfed8972ab1f09c3b7cfd22ea80213a2f02eb9e5a (patch)
tree219c0257a0e44b48965fb2dc5a1f2e2818969f9f /sed.c
parent935ee84bff78dec841e11734877059e97995323f (diff)
downloadbusybox-w32-fed8972ab1f09c3b7cfd22ea80213a2f02eb9e5a.tar.gz
busybox-w32-fed8972ab1f09c3b7cfd22ea80213a2f02eb9e5a.tar.bz2
busybox-w32-fed8972ab1f09c3b7cfd22ea80213a2f02eb9e5a.zip
Made a correction to a bad test expression. Props to Larry Doolittle for
spotting this one. git-svn-id: svn://busybox.net/trunk/busybox@2394 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sed.c')
-rw-r--r--sed.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sed.c b/sed.c
index 897c290d5..07e3a3e30 100644
--- a/sed.c
+++ b/sed.c
@@ -317,7 +317,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr)
317 317
318 /* now we need to go through * and: s/\\[\r\n]$/\n/g on the edit line */ 318 /* now we need to go through * and: s/\\[\r\n]$/\n/g on the edit line */
319 while (ptr[idx]) { 319 while (ptr[idx]) {
320 while (ptr[idx] != '\\' && (ptr[idx+1] != '\n' || ptr[idx+1] != '\r')) { 320 while (ptr[idx] != '\\' || (ptr[idx+1] != '\n' && ptr[idx+1] != '\r')) {
321 idx++; 321 idx++;
322 if (!ptr[idx]) { 322 if (!ptr[idx]) {
323 goto out; 323 goto out;
@@ -343,7 +343,6 @@ out:
343 /* this accounts for the fact that A) we started at index 3, not at index 343 /* this accounts for the fact that A) we started at index 3, not at index
344 * 0 and B) that we added an extra '\n' at the end (if you think the next 344 * 0 and B) that we added an extra '\n' at the end (if you think the next
345 * line should read 'idx += 4' remember, arrays are zero-based) */ 345 * line should read 'idx += 4' remember, arrays are zero-based) */
346
347 idx += 3; 346 idx += 3;
348 347
349 return idx; 348 return idx;