aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-04-09 07:51:43 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-04-09 07:51:43 +0000
commit2410386611e104ee4e078b2182e3b9b2f9f3adff (patch)
tree9a663dfedb235ede01df7efd69163a67ee6f1d97
parentbd9b32bc0df1039ef1962b558ba258e4bdb1bbfd (diff)
downloadbusybox-w32-2410386611e104ee4e078b2182e3b9b2f9f3adff.tar.gz
busybox-w32-2410386611e104ee4e078b2182e3b9b2f9f3adff.tar.bz2
busybox-w32-2410386611e104ee4e078b2182e3b9b2f9f3adff.zip
fix substitution when replacing with &, we shouldnt check for an escape charcter. Its already been taken care of _somewhere_ else
-rw-r--r--editors/sed.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c
index db3171879..912318c04 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -722,9 +722,8 @@ static void print_subst_w_backrefs(const char *line, const char *replace,
722 * fortunately, regmatch[0] contains the indicies to the whole matched 722 * fortunately, regmatch[0] contains the indicies to the whole matched
723 * expression (kinda seems like it was designed for just such a 723 * expression (kinda seems like it was designed for just such a
724 * purpose...) */ 724 * purpose...) */
725 else if (replace[i] == '&' && replace[i - 1] != '\\') { 725 else if (replace[i] == '&') {
726 int j; 726 int j;
727
728 for (j = regmatch[0].rm_so; j < regmatch[0].rm_eo; j++) 727 for (j = regmatch[0].rm_so; j < regmatch[0].rm_eo; j++)
729 pipeputc(line[j]); 728 pipeputc(line[j]);
730 } 729 }