parse.c (ffe_parse_file): Handle the case that main_input_filename is NULL.
authorRoger Sayle <roger@eyesopen.com>
Sun, 29 Feb 2004 14:12:20 +0000 (14:12 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 29 Feb 2004 14:12:20 +0000 (14:12 +0000)
* parse.c (ffe_parse_file): Handle the case that main_input_filename
is NULL.

From-SVN: r78650

gcc/f/ChangeLog
gcc/f/parse.c

index 0234eb4b80b3c0a70d8cdd5c1d2a48384f4a46cf..a9941c43b1ea41bdbc56024f226e782e9d47b98f 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-29  Roger Sayle  <roger@eyesopen.com>
+
+       * parse.c (ffe_parse_file): Handle the case that main_input_filename
+       is NULL.
+
 2004-02-24  Michael Matz  <matz@suse.de>
 
        * Make-lang.in (sta.o-warn): Delete.
index e21dcce87b20dcb12146802c45a4fcbb742ca33c..d822773f35be3bca8ca4aa97559ca1d8f49733aa 100644 (file)
@@ -31,6 +31,7 @@ extern FILE *finput;
 void
 ffe_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
 {
+  const char *fname;
   ffewhereFile wf;
 
   if (ffe_is_version ())
@@ -39,8 +40,9 @@ ffe_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
   if (!ffe_is_pedantic ())
     ffe_set_is_pedantic (pedantic);
 
-  wf = ffewhere_file_new (main_input_filename, strlen (main_input_filename));
-  ffecom_file (main_input_filename);
+  fname = main_input_filename ? main_input_filename : "<stdin>";
+  wf = ffewhere_file_new (fname, strlen (fname));
+  ffecom_file (fname);
   ffe_file (wf, finput);
 
   ffecom_finish_compile ();