]> code.delx.au - gnu-emacs/commitdiff
(main): Exit with EXIT_FAILURE if BROWSE file doesn't exist, is not seekable, not...
authorMasatake YAMATO <jet@gyve.org>
Sat, 3 Jun 2006 17:49:36 +0000 (17:49 +0000)
committerMasatake YAMATO <jet@gyve.org>
Sat, 3 Jun 2006 17:49:36 +0000 (17:49 +0000)
lib-src/ChangeLog
lib-src/ebrowse.c

index eaaa293e2934f59c0e493d0c9ccfda937faba68d..40b4779dea437fa9a5381c688974a658eff4cbf2 100644 (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>
 
        * makefile.w32-in (ALL): Add sorted-doc and digest-doc.
index 94fa9114d2317a99124e97fbc329253c9c37905a..398dd10896e56ef25f7f2719e616c3744d6f301e 100644 (file)
@@ -3909,17 +3909,31 @@ main (argc, argv)
 
          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);
        }