Always apply commands with no specified range.
authorMatt Kraai <kraai@debian.org>
Thu, 21 Jun 2001 13:57:51 +0000 (13:57 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 21 Jun 2001 13:57:51 +0000 (13:57 -0000)
editors/sed.c
sed.c

index 73ed058e237fa1a2486bad4d194e74b87d7257f5..e7208b0b550dfbcc93bce36e512c8e1bd2b4ec75 100644 (file)
@@ -608,6 +608,10 @@ static void process_file(FILE *file)
                         * entry point into sedding...
                         */
                        if (
+                                       /* no range necessary */
+                                       (sed_cmds[i].beg_line == 0 && sed_cmds[i].end_line == 0 &&
+                                        sed_cmds[i].beg_match == NULL &&
+                                        sed_cmds[i].end_match == NULL) ||
                                        /* this line number is the first address we're looking for */
                                        (sed_cmds[i].beg_line && (sed_cmds[i].beg_line == linenum)) ||
                                        /* this line matches our first address regex */
diff --git a/sed.c b/sed.c
index 73ed058e237fa1a2486bad4d194e74b87d7257f5..e7208b0b550dfbcc93bce36e512c8e1bd2b4ec75 100644 (file)
--- a/sed.c
+++ b/sed.c
@@ -608,6 +608,10 @@ static void process_file(FILE *file)
                         * entry point into sedding...
                         */
                        if (
+                                       /* no range necessary */
+                                       (sed_cmds[i].beg_line == 0 && sed_cmds[i].end_line == 0 &&
+                                        sed_cmds[i].beg_match == NULL &&
+                                        sed_cmds[i].end_match == NULL) ||
                                        /* this line number is the first address we're looking for */
                                        (sed_cmds[i].beg_line && (sed_cmds[i].beg_line == linenum)) ||
                                        /* this line matches our first address regex */