diff options
author | markw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-11-03 20:02:35 +0000 |
---|---|---|
committer | markw <markw@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-11-03 20:02:35 +0000 |
commit | f63f29f6f6619ab4e115323a1e896a1798707062 (patch) | |
tree | 62df2eeee033b14ef52f67cb5a2bde21b647829d /sed.c | |
parent | 0dba359714cad63e8321665caf94ff4d9e61e787 (diff) | |
download | busybox-w32-f63f29f6f6619ab4e115323a1e896a1798707062.tar.gz busybox-w32-f63f29f6f6619ab4e115323a1e896a1798707062.tar.bz2 busybox-w32-f63f29f6f6619ab4e115323a1e896a1798707062.zip |
Now, what was that logic block doing up there?
git-svn-id: svn://busybox.net/trunk/busybox@1283 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sed.c')
-rw-r--r-- | sed.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -537,12 +537,6 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line) | |||
537 | int altered = 0; | 537 | int altered = 0; |
538 | regmatch_t *regmatch = NULL; | 538 | regmatch_t *regmatch = NULL; |
539 | 539 | ||
540 | /* if the user specified that they didn't want anything printed (i.e. a -n | ||
541 | * flag and no 'p' flag after the s///), then there's really no point doing | ||
542 | * anything here. */ | ||
543 | if (be_quiet && !sed_cmd->sub_p) | ||
544 | return 0; | ||
545 | |||
546 | /* we only proceed if the substitution 'search' expression matches */ | 540 | /* we only proceed if the substitution 'search' expression matches */ |
547 | if (regexec(sed_cmd->sub_match, line, 0, NULL, 0) == REG_NOMATCH) | 541 | if (regexec(sed_cmd->sub_match, line, 0, NULL, 0) == REG_NOMATCH) |
548 | return 0; | 542 | return 0; |
@@ -615,6 +609,12 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line) | |||
615 | * flag exists in the first place. | 609 | * flag exists in the first place. |
616 | */ | 610 | */ |
617 | 611 | ||
612 | /* if the user specified that they didn't want anything printed (i.e. a -n | ||
613 | * flag and no 'p' flag after the s///), then there's really no point doing | ||
614 | * anything here. */ | ||
615 | if (be_quiet && !sed_cmd->sub_p) | ||
616 | break; | ||
617 | |||
618 | /* we print the line once, unless we were told to be quiet */ | 618 | /* we print the line once, unless we were told to be quiet */ |
619 | if (!be_quiet) | 619 | if (!be_quiet) |
620 | altered = do_subst_command(sed_cmd, line); | 620 | altered = do_subst_command(sed_cmd, line); |