aboutsummaryrefslogtreecommitdiff
path: root/fixincludes/fixincl.c
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/fixincl.c
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/fixincl.c')
-rw-r--r--fixincludes/fixincl.c5
1 files changed, 4 insertions, 1 deletions
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);
}
}