diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-26 15:19:36 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-26 15:19:36 +0000 |
commit | 74f5b093fc9628b1494ee81680fc059befb13000 (patch) | |
tree | e0feaad272b918928001fe12ba340e17a2ae7878 /libgfortran | |
parent | c3fc0093289bb2312ccc8d82478951d80dfd73d3 (diff) | |
download | gcc-74f5b093fc9628b1494ee81680fc059befb13000.tar.gz |
2014-05-26 Tobias Burnus <burnus@net-b.de>
PR fortran/55117
* trans-io.c (nml_full_name, transfer_namelist_element): Insert
a '+' rather then '%' to differentiate namelist variable names
that are based on extended derived types.
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210934 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 10 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 37 |
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; |