fix substitution when replacing with &, we shouldnt check for an escape charcter...
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 9 Apr 2003 07:51:43 +0000 (07:51 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 9 Apr 2003 07:51:43 +0000 (07:51 -0000)
editors/sed.c

index db3171879fa67543f9d0c6b89eda211a4da8b379..912318c04c81a502a5fd98ee5c9a3741e29630ec 100644 (file)
@@ -722,9 +722,8 @@ static void print_subst_w_backrefs(const char *line, const char *replace,
                 * fortunately, regmatch[0] contains the indicies to the whole matched
                 * expression (kinda seems like it was designed for just such a
                 * purpose...) */
-               else if (replace[i] == '&' && replace[i - 1] != '\\') {
+               else if (replace[i] == '&') {
                        int j;
-
                        for (j = regmatch[0].rm_so; j < regmatch[0].rm_eo; j++)
                                pipeputc(line[j]);
                }