Commit 9786122
committed
Bugfix for pymlreplace
The offset had been converted to an idx_t, but in some circumstances it
needed to be negative. Introduced an offset_t (int) typedef, and made
the currentOffset an offset_t. This probably breaks some lint rules about
signed/unsigned conversions, but not sure what is best to do.
Also fixed a logic error with the "next" position to start from after
making a replacement. The Python version of the string obviously doesn't
change after a replacement, therefore the next point can be immediately after
the end of the previous found target, ignoring the size of the replacement
string.1 parent e2275dd commit 9786122
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | | - | |
| 561 | + | |
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
658 | | - | |
659 | | - | |
| 657 | + | |
| 658 | + | |
660 | 659 | | |
661 | 660 | | |
662 | 661 | | |
| |||
916 | 915 | | |
917 | 916 | | |
918 | 917 | | |
919 | | - | |
| 918 | + | |
920 | 919 | | |
921 | 920 | | |
922 | 921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
82 | 89 | | |
83 | 90 | | |
0 commit comments