aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorMasatake YAMATO2006-06-03 17:49:36 +0000
committerMasatake YAMATO2006-06-03 17:49:36 +0000
commit0f29c66d2557458cd49b32ad48d5baed25533295 (patch)
tree6cb8847f76e828d15ea59cb619a2a865129ed0c6 /lib-src
parent9781fb53c897dc37a13a490e988977758029a3c2 (diff)
downloademacs-0f29c66d2557458cd49b32ad48d5baed25533295.tar.gz
emacs-0f29c66d2557458cd49b32ad48d5baed25533295.zip
(main): Exit with EXIT_FAILURE if BROWSE file doesn't exist, is not seekable, not is failed in ftall.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/ebrowse.c22
2 files changed, 23 insertions, 4 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index eaaa293e293..40b4779dea4 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12006-06-04 Masatake YAMATO <jet@gyve.org>
2
3 * ebrowse.c (main): Exit with EXIT_FAILURE if BROWSE file
4 doesn't exist, is not seekable, not is failed in ftall.
5
12006-06-03 Eli Zaretskii <eliz@gnu.org> 62006-06-03 Eli Zaretskii <eliz@gnu.org>
2 7
3 * makefile.w32-in (ALL): Add sorted-doc and digest-doc. 8 * makefile.w32-in (ALL): Add sorted-doc and digest-doc.
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 94fa9114d23..398dd10896e 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -3909,17 +3909,31 @@ main (argc, argv)
3909 3909
3910 fp = fopen (out_filename, "r"); 3910 fp = fopen (out_filename, "r");
3911 if (fp == NULL) 3911 if (fp == NULL)
3912 yyerror ("file `%s' must exist for --append", out_filename); 3912 {
3913 yyerror ("file `%s' must exist for --append", out_filename);
3914 exit (EXIT_FAILURE);
3915 }
3913 3916
3914 rc = fseek (fp, 0, SEEK_END); 3917 rc = fseek (fp, 0, SEEK_END);
3915 if (rc == -1) 3918 if (rc == -1)
3916 yyerror ("error seeking in file `%s'", out_filename); 3919 {
3920 yyerror ("error seeking in file `%s'", out_filename);
3921 exit (EXIT_FAILURE);
3922 }
3917 3923
3918 rc = ftell (fp); 3924 rc = ftell (fp);
3919 if (rc == -1) 3925 if (rc == -1)
3920 yyerror ("error getting size of file `%s'", out_filename); 3926 {
3927 yyerror ("error getting size of file `%s'", out_filename);
3928 exit (EXIT_FAILURE);
3929 }
3930
3921 else if (rc == 0) 3931 else if (rc == 0)
3922 yyerror ("file `%s' is empty", out_filename); 3932 {
3933 yyerror ("file `%s' is empty", out_filename);
3934 /* It may be ok to use an empty file for appending.
3935 exit (EXIT_FAILURE); */
3936 }
3923 3937
3924 fclose (fp); 3938 fclose (fp);
3925 } 3939 }