summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2003-08-31 15:22:10 +0000
committerDom Lachowicz <domlachowicz@gmail.com>2003-08-31 15:22:10 +0000
commit1fb660f6cc2d2e89026c9d5ab74ab00548da2826 (patch)
tree68f7e15ff5aa03c7458faef05c539d459bcf4366
parent6a604bc4727dd2358139636217ec41c5f5cea5a6 (diff)
downloadenchant-1fb660f6cc2d2e89026c9d5ab74ab00548da2826.tar.gz
fix ispell -a compatibility mode
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@20837 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--tests/enchant-ispell.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/enchant-ispell.c b/tests/enchant-ispell.c
index 141d7cb..e12aa0e 100644
--- a/tests/enchant-ispell.c
+++ b/tests/enchant-ispell.c
@@ -216,7 +216,7 @@ parse_file (FILE * in, FILE * out, IspellMode_t mode)
const gchar * lang;
size_t pos;
- gboolean was_last_line = FALSE;
+ gboolean was_last_line = FALSE, corrected_something = FALSE;
if (mode == MODE_A)
print_version (out);
@@ -240,8 +240,10 @@ parse_file (FILE * in, FILE * out, IspellMode_t mode)
if (str->len) {
+ corrected_something = FALSE;
token_ptr = tokens = tokenize_line (str);
while (tokens != NULL) {
+ corrected_something = TRUE;
word = (GString *)tokens->data;
tokens = tokens->next;
@@ -260,15 +262,11 @@ parse_file (FILE * in, FILE * out, IspellMode_t mode)
if (token_ptr)
g_slist_free (token_ptr);
- else if (mode == MODE_A)
- fwrite ("\n", 1, 1, out);
}
- else if (mode == MODE_A && !was_last_line)
- fwrite ("\n", 1, 1, out);
- if (mode == MODE_A)
+ if (mode == MODE_A && corrected_something)
fwrite ("\n", 1, 1, out);
-
+
g_string_truncate (str, 0);
}