- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit51e78ab
committed
Avoid use of sscanf() to parse ispell dictionary files.
It turns out that on FreeBSD-derived platforms (including OS X), the*scanf() family of functions is pretty much brain-dead about multibytecharacters. In particular it will apply isspace() to individual bytesof input even when those bytes are part of a multibyte character, thusallowing false recognition of a field-terminating space.We appear to have little alternative other than instituting a codingrule that *scanf() is not to be used if the input string might containmultibyte characters. (There was some discussion of relying on "%ls",but that probably just moves the portability problem somewhere else,and besides it doesn't fully prevent BSD *scanf() from using isspace().)This patch is a down payment on that: it gets rid of use of sscanf()to parse ispell dictionary files, which are certainly at great riskof having a problem. The code is cleaner this way anyway, thougha bit longer.In passing, improve a few comments.Report and patch by Artur Zakirov, reviewed and somewhat tweaked by me.Back-patch to all supported branches.1 parentc5e9b77 commit51e78ab
1 file changed
+153
-13
lines changedLines changed: 153 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
457 | 457 |
| |
458 | 458 |
| |
459 | 459 |
| |
| 460 | + | |
| 461 | + | |
460 | 462 |
| |
461 |
| - | |
| 463 | + | |
462 | 464 |
| |
463 |
| - | |
| 465 | + | |
464 | 466 |
| |
465 |
| - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
466 | 470 |
| |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
467 | 603 |
| |
468 | 604 |
| |
469 | 605 |
| |
| |||
618 | 754 |
| |
619 | 755 |
| |
620 | 756 |
| |
621 |
| - | |
622 |
| - | |
623 | 757 |
| |
624 | 758 |
| |
625 | 759 |
| |
| |||
682 | 816 |
| |
683 | 817 |
| |
684 | 818 |
| |
685 |
| - | |
686 |
| - | |
687 | 819 |
| |
688 | 820 |
| |
689 | 821 |
| |
| |||
692 | 824 |
| |
693 | 825 |
| |
694 | 826 |
| |
| 827 | + | |
| 828 | + | |
695 | 829 |
| |
696 | 830 |
| |
697 | 831 |
| |
698 |
| - | |
| 832 | + | |
699 | 833 |
| |
700 | 834 |
| |
701 | 835 |
| |
702 | 836 |
| |
703 |
| - | |
| 837 | + | |
| 838 | + | |
704 | 839 |
| |
705 | 840 |
| |
706 |
| - | |
| 841 | + | |
707 | 842 |
| |
708 | 843 |
| |
709 | 844 |
| |
| |||
722 | 857 |
| |
723 | 858 |
| |
724 | 859 |
| |
725 |
| - | |
| 860 | + | |
726 | 861 |
| |
727 | 862 |
| |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
728 | 867 |
| |
729 | 868 |
| |
730 | 869 |
| |
| |||
800 | 939 |
| |
801 | 940 |
| |
802 | 941 |
| |
| 942 | + | |
803 | 943 |
| |
804 | 944 |
| |
805 | 945 |
| |
806 |
| - | |
807 |
| - | |
| 946 | + | |
| 947 | + | |
808 | 948 |
| |
809 | 949 |
| |
810 | 950 |
| |
|
0 commit comments
Comments
(0)