2013-10-09 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Oct 2013 19:32:22 +0000 (19:32 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Oct 2013 19:32:22 +0000 (19:32 +0000)
        PR fortran/58226
        * options.c (gfc_get_option_string): Handle zero arg case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203394 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/options.c

index 4463ecd..2a3be8d 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/58226
+       * options.c (gfc_get_option_string): Handle zero arg case.
+
 2013-10-02  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/58593
index 3a9c508..6e4e7c1 100644 (file)
@@ -1166,6 +1166,10 @@ gfc_get_option_string (void)
   size_t len, pos;
   char *result;
 
+  /* Allocate and return a one-character string with '\0'.  */
+  if (!save_decoded_options_count)
+    return XCNEWVEC (char, 1);
+
   /* Determine required string length.  */
 
   len = 0;