aboutsummaryrefslogtreecommitdiff
path: root/fixincludes
diff options
context:
space:
mode:
authorBruce Korb <bkorb@gnu.org>2005-11-25 05:57:10 +0000
committerBruce Korb <korbb@gcc.gnu.org>2005-11-25 05:57:10 +0000
commit66f788b0b33ae14ca966f1925c9a3c3aff2144a1 (patch)
treeb7fc0bb2d1f51e6270efcf55f97630706b3b7fdf /fixincludes
parentf375f4624065d9aae73af45883cbc45da4cda75a (diff)
downloadgcc-66f788b0b33ae14ca966f1925c9a3c3aff2144a1.zip
gcc-66f788b0b33ae14ca966f1925c9a3c3aff2144a1.tar.gz
gcc-66f788b0b33ae14ca966f1925c9a3c3aff2144a1.tar.bz2
Check the last byte for '\n'
From-SVN: r107492
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/ChangeLog5
-rw-r--r--fixincludes/fixincl.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index eb73943..0121729 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 250f0b0..f8941c3 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);
}
}