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 40eef80..9f3af33 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;
                }