summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-19 15:47:46 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-06-19 15:47:46 (GMT)
commitc2c7aa4b0d16049322ca2ebc69ca1093f6944e3a (patch)
treef2e5fd85be96d7a1b2f3ae5847dfea85f6c457ad
parent9b814ca6335806a6eb47e22805620ec81d5d849d (diff)
downloadbusybox-c2c7aa4b0d16049322ca2ebc69ca1093f6944e3a.tar.gz
busybox-c2c7aa4b0d16049322ca2ebc69ca1093f6944e3a.tar.bz2
sed: trivial code shrink
function old new delta sed_main 685 667 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/sed.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 28f0c73..7af8f86 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;
}