1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

(main): Exit with EXIT_FAILURE if BROWSE file doesn't exist, is not seekable, not is failed in ftall.

This commit is contained in:
Masatake YAMATO 2006-06-03 17:49:36 +00:00
parent 9781fb53c8
commit 0f29c66d25
2 changed files with 23 additions and 4 deletions

View File

@ -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> 2006-06-03 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (ALL): Add sorted-doc and digest-doc. * makefile.w32-in (ALL): Add sorted-doc and digest-doc.

View File

@ -3909,17 +3909,31 @@ main (argc, argv)
fp = fopen (out_filename, "r"); fp = fopen (out_filename, "r");
if (fp == NULL) 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); rc = fseek (fp, 0, SEEK_END);
if (rc == -1) 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); rc = ftell (fp);
if (rc == -1) 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) 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); fclose (fp);
} }