--- /dev/null
+! { dg-do run )
+! { dg-shouldfail "Missing quote" }
+program nml_quotes_bug
+ implicit none
+ integer :: unit = 10
+ character(8) :: c1, c2
+ namelist /tovs_obs_chan/ c1, c2
+ open (unit ,file="nml-quotes-bug.nml")
+ write(unit,*) "&tovs_obs_chan"
+ write(unit,*) " c1 = '1',"
+ write(unit,*) " c2 = 2a ,"
+ write(unit,*) "/"
+ rewind(unit)
+ read (unit ,nml=tovs_obs_chan)
+ close(unit ,status="delete")
+end program nml_quotes_bug
CASE_SEPARATORS:
case EOF:
+ /* At this point we have been reading a string of digits. Now we see
+ the end of these digits without seeing the closing quote and not
+ seeing the '*' for a repeat count. When in namelist mode, if it
+ was a string of digits it should have had the closing quote. */
if (dtp->u.p.namelist_mode)
{
snprintf (message, IOMSG_LEN, "Missing quote while reading item %d",
get_string:
+ /* We could be at the beginning of a string or partially through a string
+ that began with all digits. Either way, the quote character for a namelist
+ read should have been set. */
+ if (dtp->u.p.namelist_mode && (quote == ' '))
+ {
+ snprintf (message, IOMSG_LEN, "Missing quote while reading item %d",
+ dtp->u.p.item_count);
+ generate_error (&dtp->common, LIBERROR_READ_VALUE, message);
+ }
+
for (;;)
{
if ((c = next_char (dtp)) == EOF)