diff options
author | Matt Kraai <kraai@debian.org> | 2001-11-12 16:44:55 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-11-12 16:44:55 +0000 |
commit | a5f09c668e8571844c065041f3c1f122fa5c62fe (patch) | |
tree | 7bb51b4c59e729627b3113a5528c59a0351b1de5 /editors | |
parent | c5f9a9dd0cf2154de6a581ffc9018715a02c118b (diff) | |
download | busybox-w32-a5f09c668e8571844c065041f3c1f122fa5c62fe.tar.gz busybox-w32-a5f09c668e8571844c065041f3c1f122fa5c62fe.tar.bz2 busybox-w32-a5f09c668e8571844c065041f3c1f122fa5c62fe.zip |
Use fopen wrapper.
Diffstat (limited to 'editors')
-rw-r--r-- | editors/sed.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/editors/sed.c b/editors/sed.c index 428b516ad..3afa64e8f 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -804,7 +804,7 @@ static void process_file(FILE *file) | |||
804 | 804 | ||
805 | extern int sed_main(int argc, char **argv) | 805 | extern int sed_main(int argc, char **argv) |
806 | { | 806 | { |
807 | int opt; | 807 | int opt, status = EXIT_SUCCESS; |
808 | 808 | ||
809 | #ifdef CONFIG_FEATURE_CLEAN_UP | 809 | #ifdef CONFIG_FEATURE_CLEAN_UP |
810 | /* destroy command strings on exit */ | 810 | /* destroy command strings on exit */ |
@@ -851,15 +851,13 @@ extern int sed_main(int argc, char **argv) | |||
851 | int i; | 851 | int i; |
852 | FILE *file; | 852 | FILE *file; |
853 | for (i = optind; i < argc; i++) { | 853 | for (i = optind; i < argc; i++) { |
854 | file = fopen(argv[i], "r"); | 854 | if (file = wfopen(argv[i], "r")) { |
855 | if (file == NULL) { | ||
856 | perror_msg("%s", argv[i]); | ||
857 | } else { | ||
858 | process_file(file); | 855 | process_file(file); |
859 | fclose(file); | 856 | fclose(file); |
860 | } | 857 | } else |
858 | status = EXIT_FAILURE; | ||
861 | } | 859 | } |
862 | } | 860 | } |
863 | 861 | ||
864 | return 0; | 862 | return status; |
865 | } | 863 | } |