Index: trunk/extensions/NativePreprocessor/preprocesstoobj.c |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | static int strpos(const char* haystack, int haystack_len, const char* needle, int needle_len, int offset) { |
17 | 17 | int i; |
18 | 18 | |
19 | | - for ( i = offset; i < haystack_len - needle_len; i++ ) { |
| 19 | + for ( i = offset; i <= haystack_len - needle_len; i++ ) { |
20 | 20 | if ( !memcmp( haystack + i, needle, needle_len ) ) { |
21 | 21 | return i; |
22 | 22 | } |
— | — | @@ -316,7 +316,7 @@ |
317 | 317 | |
318 | 318 | int wsStart; |
319 | 319 | for (wsStart = i - 1; wsStart > 0; wsStart--) { |
320 | | - if ( text[wsStart] != ' ') { /* It can't go over wikitext_len because the php string has a \0 terminator, too */ |
| 320 | + if ( text[wsStart] != ' ' ) { /* It can't go over wikitext_len because the php string has a \0 terminator, too */ |
321 | 321 | wsStart++; |
322 | 322 | break; |
323 | 323 | } |
— | — | @@ -515,7 +515,7 @@ |
516 | 516 | // Comment found at line end |
517 | 517 | // Search for equals signs before the comment |
518 | 518 | for (searchStart = parentNode->visualEnd; searchStart > 0; --searchStart) { |
519 | | - if (text[i] != ' ' && text[i] != '\t') |
| 519 | + if (text[searchStart] != ' ' && text[searchStart] != '\t') |
520 | 520 | break; |
521 | 521 | } |
522 | 522 | } |