diff options
author | korbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-25 05:57:10 +0000 |
---|---|---|
committer | korbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-25 05:57:10 +0000 |
commit | 62248de66993ed87f96e2d9753509d9607928083 (patch) | |
tree | b7fc0bb2d1f51e6270efcf55f97630706b3b7fdf /fixincludes | |
parent | b8430f521bb25af92dd08b8525dd4435676ee196 (diff) | |
download | gcc-62248de66993ed87f96e2d9753509d9607928083.tar.gz |
Check the last byte for '\n'
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 5 | ||||
-rw-r--r-- | fixincludes/fixincl.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index eb739434b33..0121729026d 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,8 @@ +2005-11-24 Bruce Korb <bkorb@gnu.org> + + * fixincl.c(write_replacement) "here strings" in AutoGen often/generally + don't have a terminating newline. Check the last byte for '\n'. + 2005-11-13 Andreas Jaeger <aj@suse.de> * check.tpl: Handle CVS additionally. diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c index 250f0b01b62..f8941c39c16 100644 --- a/fixincludes/fixincl.c +++ b/fixincludes/fixincl.c @@ -1202,7 +1202,10 @@ write_replacement (tFixDesc* p_fixd) { FILE* out_fp = create_file (); - fputs (pz_text, out_fp); + size_t sz = strlen (pz_text); + fwrite (pz_text, sz, 1, out_fp); + if (pz_text[ sz-1 ] != '\n') + fputc ('\n', out_fp); fclose (out_fp); } } |