Mercurial > pidgin
comparison plugins/spellchk.c @ 11296:87a7fdd3ffcc
[gaim-migrate @ 13496]
Handle non-unix text files.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 18 Aug 2005 04:59:16 +0000 |
parents | a4ce03725025 |
children | e1c55e65ab8e |
comparison
equal
deleted
inserted
replaced
11295:ee1b890760be | 11296:87a7fdd3ffcc |
---|---|
504 int spos = pos; | 504 int spos = pos; |
505 | 505 |
506 if (pos == len) | 506 if (pos == len) |
507 return 0; | 507 return 0; |
508 | 508 |
509 while (ibuf[pos++] != '\n') { | 509 while (!(ibuf[pos] == '\n' || |
510 (ibuf[pos] == '\r' && ibuf[pos + 1] != '\n'))) | |
511 { | |
512 pos++; | |
510 if (pos == len) | 513 if (pos == len) |
511 return 0; | 514 return 0; |
512 } | 515 } |
513 | 516 |
514 pos--; | 517 if (pos != 0 && ibuf[pos] == '\n' && ibuf[pos - 1] == '\r') |
515 | 518 ibuf[pos - 1] = '\0'; |
516 ibuf[pos] = 0; | 519 |
520 ibuf[pos] = '\0'; | |
517 *buf = &ibuf[spos]; | 521 *buf = &ibuf[spos]; |
518 | 522 |
519 pos++; | 523 pos++; |
520 *position = pos; | 524 *position = pos; |
521 | 525 |