summaryrefslogtreecommitdiffhomepage
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-19 17:51:06 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-06-19 17:51:06 +0200
commiteb08b6ed5cc7bb764658cd7a3b829e2b3aac4abc (patch)
treec1568f8427244069d7a62bf1fc220cd83e0d7703 /editors
parent020465218ccff1195a47a890037db37d0395c9d9 (diff)
sed: trivial code shrink -18 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/sed.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 28f0c7318..7af8f867a 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1333,7 +1333,6 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
if (opt & OPT_in_place)
bb_error_msg_and_die(bb_msg_requires_arg, "-i");
add_input_file(stdin);
- process_files();
} else {
int i;
FILE *file;
@@ -1379,9 +1378,13 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
free(G.outname);
G.outname = NULL;
}
- if (G.input_file_count > G.current_input_file)
- process_files();
+ /* Here, to handle "sed 'cmds' nonexistent_file" case we did:
+ * if (G.current_input_file >= G.input_file_count)
+ * return status;
+ * but it's not needed since process_files() works correctly
+ * in this case too. */
}
+ process_files();
return status;
}