diff options
author | Eric Albright <eric_albright@sil.org> | 2008-05-02 06:02:12 +0000 |
---|---|---|
committer | Eric Albright <eric_albright@sil.org> | 2008-05-02 06:02:12 +0000 |
commit | 0ed48af1f728561b45969096c698e900a600028e (patch) | |
tree | 515de40a8deb904efb97a90330c5c77f4585bfb7 /src/pwl.c | |
parent | f04f81e52d73fce51d5f2451bd0a2825b8c15caa (diff) | |
download | enchant-0ed48af1f728561b45969096c698e900a600028e.tar.gz |
Fixes case where if a personal dictionary was edited such that it didn't end with a trailing new line, adding a word would not work correctly.
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@23735 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
Diffstat (limited to 'src/pwl.c')
-rw-r--r-- | src/pwl.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -388,8 +388,11 @@ void enchant_pwl_add(EnchantPWL *pwl, if(g_stat(pwl->filename, &stats)==0) pwl->file_changed = stats.st_mtime; - fwrite (word, sizeof(char), len, f); + /* we write the new line first since we can't guarantee + that the file was terminated by a new line before + and we are just appending to the end of the file */ fwrite ("\n", sizeof(char), 1, f); + fwrite (word, sizeof(char), len, f); enchant_unlock_file (f); fclose (f); } |