Changeset 439 for trunk/src/helpers/nls.c
- Timestamp:
- May 25, 2018, 4:38:54 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/nls.c
r390 r439 281 281 // we're on DBCS: 282 282 283 // we can't find c if it is a leadingbyte284 if (G_afLeadByte[c] != TYPE_SBCS)283 // we can't find c if it is a DBCS lead byte 284 if (G_afLeadByte[c]) 285 285 return NULL; 286 286 … … 289 289 ++p2) 290 290 { 291 // check _previous_ DBCS type and refresh 292 // DBCS type accordingly 291 // Set current DBCS scan state based of _previous_ DBCS scan state 293 292 switch (ulDBCSType) 294 293 { 295 case TYPE_SBCS:296 case TYPE_DBCS_2ND:297 ulDBCSType = G_afLeadByte[*p2];298 // we can safely do the test here (and skip rechecking299 // the type) because c can't possibly be a leading byte300 // V0.9.20 (2002-07-22) [lafaix]301 if (*p2 == c)302 return (PSZ)p2;303 break;304 305 294 case TYPE_DBCS_1ST : 306 295 ulDBCSType = TYPE_DBCS_2ND; 307 296 break; 297 case TYPE_SBCS: 298 if (G_afLeadByte[*p2]) 299 ulDBCSType = TYPE_DBCS_1ST; 300 break; 308 301 } 309 } 310 311 /* old code V0.9.20 (2002-07-22) [umoeller] 312 // we're on DBCS: 313 for (p2 = p; 314 *p2; 315 ++p2) 316 { 302 303 if (ulDBCSType != TYPE_DBCS_1ST) { 317 304 if (*p2 == c) 318 {319 // match: return this only if it's SBCS;320 // if it's a DBCS lead char, skip it321 switch (ulDBCS = nlsQueryDBCSChar(p, p2 - p))322 {323 case TYPE_SBCS:324 305 return (PSZ)p2; 325 326 case TYPE_DBCS_1ST: 327 ++p2; 306 ulDBCSType = TYPE_SBCS; // Ensure next char checked for DBCS lead 328 307 } 329 } 330 } 331 */ 308 309 } // for 332 310 333 311 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.