Changeset 521
- Timestamp:
- 04/28/08 18:30:18 (2 months ago)
- Files:
-
- trunk/thune/parse.c (modified) (2 diffs)
- trunk/thune/series.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/thune/parse.c
r519 r521 36 36 extern int ur_matchString( const UString* strA, int iA, 37 37 const UString* strB, int iB, int matchCase ); 38 extern int ur_findString( const UString* strA, int iA, 39 const UString* strB, int iB, int matchCase ); 38 extern int ur_findString( const UString* strA, UIndex iA, UIndex endA, 39 const UString* strB, UIndex iB, UIndex endB, 40 int matchCase ); 40 41 41 42 … … 228 229 { 229 230 UString* pat = ur_bin(tval); 230 pos = ur_findString( istr, pos, 231 pos = ur_findString( istr, pos, pe->input.end, 231 232 pat, tval->series.it, 233 ur_sliceEnd( tval, pat ), 232 234 pe->matchCase ); 233 235 if( pos < 0 ) trunk/thune/series.c
r520 r521 2750 2750 Returns index in strA where strB is found or -1 if strB is not found. 2751 2751 */ 2752 int ur_findString( const UString* strA, int iA, 2753 const UString* strB, int iB, int matchCase ) 2752 int ur_findString( const UString* strA, UIndex iA, UIndex endA, 2753 const UString* strB, UIndex iB, UIndex endB, 2754 int matchCase ) 2754 2755 { 2755 2756 const char* it = strA->ptr.c + iA; 2756 const char* end = strA->ptr.c + strA->used;2757 const char* end = strA->ptr.c + endA; 2757 2758 const char* pat = strB->ptr.c + iB; 2758 const char* pend = strB->ptr.c + strB->used;2759 2760 assert( iA <= strA->used );2761 assert( iB <= strB->used );2759 const char* pend = strB->ptr.c + endB; 2760 2761 if( (iA >= endA) || (iB >= endB) ) 2762 return -1; 2762 2763 2763 2764 if( matchCase ) … … 2919 2920 inv = UR_CALL_CELL; 2920 2921 found = ur_findString( s1, res->series.it, 2922 ur_sliceEnd(res, s1), 2921 2923 s2, tos->series.it, 2924 ur_sliceEnd(tos, s2), 2922 2925 (inv && (ur_sel(inv) == UR_ATOM_CASE)) ); 2923 2926 if( found > -1 )
