summaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-02-27 06:44:59 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-02-27 06:44:59 +0000
commiteab3fab2659d857b9a805592a665855f914ad35d (patch)
tree9ec675d981b772586a61d5231e269a712447149f /gcc/fortran/module.c
parenta465464d02db42c647e585f20e4e538553d330e0 (diff)
downloadgcc-eab3fab2659d857b9a805592a665855f914ad35d.tar.gz
2009-02-27 Tobias Burnus <burnus@net-b.de>
PR fortran/39309 * module.c (read_md5_from_module_file): Include mod version in had-changed test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index bfc4ef9f0d2..c234879a2a1 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -4739,8 +4739,18 @@ read_md5_from_module_file (const char * filename, unsigned char md5[16])
return -1;
/* Read two lines. */
- if (fgets (buf, sizeof (buf) - 1, file) == NULL
- || fgets (buf, sizeof (buf) - 1, file) == NULL)
+ if (fgets (buf, sizeof (buf) - 1, file) == NULL)
+ {
+ fclose (file);
+ return -1;
+ }
+
+ /* The file also needs to be overwritten if the version number changed. */
+ n = strlen ("GFORTRAN module version " MOD_VERSION " created");
+ if (strncmp (buf, "GFORTRAN module version " MOD_VERSION " created", n) != 0)
+ return -1;
+
+ if (fgets (buf, sizeof (buf) - 1, file) == NULL)
{
fclose (file);
return -1;