diff mbox

patch: Fix gengtype to really detect same files

Message ID alpine.LNX.2.00.1310241550310.11100@wotan.suse.de
State New
Headers show

Commit Message

Michael Matz Oct. 24, 2013, 1:59 p.m. UTC
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.
diff mbox

Patch

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;
 }