Bugfix for: echo '123456789' | sed 's/./|&/5'
authorRob Landley <rob@landley.net>
Fri, 8 Sep 2006 00:01:02 +0000 (00:01 -0000)
committerRob Landley <rob@landley.net>
Fri, 8 Sep 2006 00:01:02 +0000 (00:01 -0000)
editors/sed.c

index 40eef80bce75b47dae7382145e9600838e3c3717..9f3af33ed303e57e587ab4bc4b42c9b12e6371c8 100644 (file)
@@ -627,7 +627,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line)
                   end of match and continue */
                if(sed_cmd->which_match && sed_cmd->which_match!=match_count) {
                        for(i=0;i<bbg.regmatch[0].rm_eo;i++)
-                               pipe_putc(oldline[i]);
+                               pipe_putc(*(oldline++));
                        continue;
                }