Mercurial > vim
comparison src/mbyte.c @ 1052:8647018a15f3 v7.0.178
updated for version 7.0-178
author | vimboss |
---|---|
date | Tue, 05 Dec 2006 21:06:46 +0000 |
parents | d4bc24e6a281 |
children | 313ec58cdc49 |
comparison
equal
deleted
inserted
replaced
1051:e14d0a530351 | 1052:8647018a15f3 |
---|---|
2292 l = n - i; /* incomplete character */ | 2292 l = n - i; /* incomplete character */ |
2293 incomplete = TRUE; | 2293 incomplete = TRUE; |
2294 } | 2294 } |
2295 /* Check directly first, it's faster. */ | 2295 /* Check directly first, it's faster. */ |
2296 for (j = 0; j < l; ++j) | 2296 for (j = 0; j < l; ++j) |
2297 { | |
2297 if (s1[i + j] != s2[i + j]) | 2298 if (s1[i + j] != s2[i + j]) |
2298 break; | 2299 break; |
2300 if (s1[i + j] == 0) | |
2301 /* Both stings have the same bytes but are incomplete or | |
2302 * have illegal bytes, accept them as equal. */ | |
2303 l = j; | |
2304 } | |
2299 if (j < l) | 2305 if (j < l) |
2300 { | 2306 { |
2301 /* If one of the two characters is incomplete return -1. */ | 2307 /* If one of the two characters is incomplete return -1. */ |
2302 if (incomplete || i + utf_byte2len(s2[i]) > n) | 2308 if (incomplete || i + utf_byte2len(s2[i]) > n) |
2303 return -1; | 2309 return -1; |