Mercurial > emacs
changeset 71199:c54897eb4a35
(main): Exit with EXIT_FAILURE if BROWSE file doesn't exist, is not seekable, not is failed in ftall.
author | Masatake YAMATO <jet@gyve.org> |
---|---|
date | Sat, 03 Jun 2006 17:49:36 +0000 |
parents | cf751e648b1d |
children | d004c9d874b7 |
files | lib-src/ChangeLog lib-src/ebrowse.c |
diffstat | 2 files changed, 23 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/ChangeLog Sat Jun 03 15:30:02 2006 +0000 +++ b/lib-src/ChangeLog Sat Jun 03 17:49:36 2006 +0000 @@ -1,3 +1,8 @@ +2006-06-04 Masatake YAMATO <jet@gyve.org> + + * ebrowse.c (main): Exit with EXIT_FAILURE if BROWSE file + doesn't exist, is not seekable, not is failed in ftall. + 2006-06-03 Eli Zaretskii <eliz@gnu.org> * makefile.w32-in (ALL): Add sorted-doc and digest-doc.
--- a/lib-src/ebrowse.c Sat Jun 03 15:30:02 2006 +0000 +++ b/lib-src/ebrowse.c Sat Jun 03 17:49:36 2006 +0000 @@ -3909,17 +3909,31 @@ fp = fopen (out_filename, "r"); if (fp == NULL) - yyerror ("file `%s' must exist for --append", out_filename); + { + yyerror ("file `%s' must exist for --append", out_filename); + exit (EXIT_FAILURE); + } rc = fseek (fp, 0, SEEK_END); if (rc == -1) - yyerror ("error seeking in file `%s'", out_filename); + { + yyerror ("error seeking in file `%s'", out_filename); + exit (EXIT_FAILURE); + } rc = ftell (fp); if (rc == -1) - yyerror ("error getting size of file `%s'", out_filename); + { + yyerror ("error getting size of file `%s'", out_filename); + exit (EXIT_FAILURE); + } + else if (rc == 0) - yyerror ("file `%s' is empty", out_filename); + { + yyerror ("file `%s' is empty", out_filename); + /* It may be ok to use an empty file for appending. + exit (EXIT_FAILURE); */ + } fclose (fp); }