Hi,

I just hit this problem where gengtype thought an existing gt-*.h header 
was the same as what it wanted to write because its prefix was indeed 
equal to the buffer, but contained some additional things afterwards.  
gengtype simply forgot to check that the file end is reached at buffer 
end.  Done with the below obivious patch.  Fixed the problem I have on 
x86_64-linux, otherwise creates same gt files, regstrapped with some other 
patches, no regressions.  Applied as r204015.


Ciao,
Michael.
-- 
        * gengtype.c (is_file_equal): Check that files will be same
        length.

Index: gengtype.c
===================================================================
--- gengtype.c  (revision 204007)
+++ gengtype.c  (working copy)
@@ -2344,6 +2344,8 @@ is_file_equal (outf_p of)
          break;
        }
     }
+  if (equal && EOF != fgetc (newfile))
+    equal = false;
   fclose (newfile);
   return equal;
 }

Reply via email to