aboutsummaryrefslogtreecommitdiff
path: root/sed.c
diff options
context:
space:
mode:
authormarkw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-07-25 20:48:44 +0000
committermarkw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-07-25 20:48:44 +0000
commite8d141d8cf681c6d483540982437770631f3b2dc (patch)
treebe9e446af32c3c02aa20fa52259e9d22245d1368 /sed.c
parentc597747761d48b7c15e3dc9fc038e38b79ca89e9 (diff)
downloadbusybox-w32-e8d141d8cf681c6d483540982437770631f3b2dc.tar.gz
busybox-w32-e8d141d8cf681c6d483540982437770631f3b2dc.tar.bz2
busybox-w32-e8d141d8cf681c6d483540982437770631f3b2dc.zip
Modified print_subst_w_backrefs() so it will print backslash escaped
characters properly, just like GNU sed. git-svn-id: svn://busybox.net/trunk/busybox@907 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sed.c')
-rw-r--r--sed.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sed.c b/sed.c
index 69a5e0324..665471913 100644
--- a/sed.c
+++ b/sed.c
@@ -500,6 +500,12 @@ static void print_subst_w_backrefs(const char *line, const char *replace, regmat
500 fputc(line[j], stdout); 500 fputc(line[j], stdout);
501 } 501 }
502 502
503 /* if we find a backslash escaped character, print the character */
504 else if (replace[i] == '\\') {
505 ++i;
506 fputc(replace[i], stdout);
507 }
508
503 /* if we find an unescaped '&' print out the whole matched text. 509 /* if we find an unescaped '&' print out the whole matched text.
504 * fortunately, regmatch[0] contains the indicies to the whole matched 510 * fortunately, regmatch[0] contains the indicies to the whole matched
505 * expression (kinda seems like it was designed for just such a 511 * expression (kinda seems like it was designed for just such a