# HG changeset patch # User Richard Laager # Date 1124341156 0 # Node ID 87a7fdd3ffccf03c9ef3168164095706e029eca0 # Parent ee1b890760be8865b17297feb58f39974069678e [gaim-migrate @ 13496] Handle non-unix text files. committer: Tailor Script diff -r ee1b890760be -r 87a7fdd3ffcc plugins/spellchk.c --- a/plugins/spellchk.c Thu Aug 18 04:57:47 2005 +0000 +++ b/plugins/spellchk.c Thu Aug 18 04:59:16 2005 +0000 @@ -506,14 +506,18 @@ if (pos == len) return 0; - while (ibuf[pos++] != '\n') { + while (!(ibuf[pos] == '\n' || + (ibuf[pos] == '\r' && ibuf[pos + 1] != '\n'))) + { + pos++; if (pos == len) return 0; } - pos--; + if (pos != 0 && ibuf[pos] == '\n' && ibuf[pos - 1] == '\r') + ibuf[pos - 1] = '\0'; - ibuf[pos] = 0; + ibuf[pos] = '\0'; *buf = &ibuf[spos]; pos++;