summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog10
-rw-r--r--libgfortran/io/list_read.c37
2 files changed, 47 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index cead92d2ed8..efa6f053a0d 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,13 @@
+2014-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/55117
+ * io/list_read.c (extended_look_ahead): New helper function to
+ scan the namelist name and look for matches with the new '+'
+ extended type parent indicator. (str_comp_extended): New
+ helper function to compare the namelist name with the varname
+ namelist. (find_nml_name): Use the new helper functions to match
+ the extended type varnames.
+
2014-05-23 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/61173
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 5ccd0220ac1..13e38f48afb 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2557,6 +2557,38 @@ err_ret:
return false;
}
+
+static bool
+extended_look_ahead (char *p, char *q)
+{
+ char *r, *s;
+
+ /* Scan ahead to find a '%' in the p string. */
+ for(r = p, s = q; *r && *s; s++)
+ if ((*s == '%' || *s == '+') && strcmp (r + 1, s + 1) == 0)
+ return true;
+ return false;
+}
+
+
+static bool
+strcmp_extended_type (char *p, char *q)
+{
+ char *r, *s;
+
+ for (r = p, s = q; *r && *s; r++, s++)
+ {
+ if (*r != *s)
+ {
+ if (*r == '%' && *s == '+' && extended_look_ahead (r, s))
+ return true;
+ break;
+ }
+ }
+ return false;
+}
+
+
static namelist_info *
find_nml_node (st_parameter_dt *dtp, char * var_name)
{
@@ -2568,6 +2600,11 @@ find_nml_node (st_parameter_dt *dtp, char * var_name)
t->touched = 1;
return t;
}
+ if (strcmp_extended_type (var_name, t->var_name))
+ {
+ t->touched = 1;
+ return t;
+ }
t = t->next;
}
return NULL;