Changeset 437 for branches/branch-1-0/src/helpers
- Timestamp:
- May 25, 2018, 3:57:47 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1-0/src/helpers/nls.c
r386 r437 262 262 // we're on DBCS: 263 263 264 // we can't find c if it is a leadingbyte265 if (G_afLeadByte[c] != TYPE_SBCS)264 // we can't find c if it is a DBCS lead byte 265 if (G_afLeadByte[c]) 266 266 return NULL; 267 267 … … 270 270 ++p2) 271 271 { 272 // check _previous_ DBCS type and refresh 273 // DBCS type accordingly 272 // Set current DBCS scan state based of _previous_ DBCS scan state 274 273 switch (ulDBCSType) 275 274 { 276 case TYPE_SBCS:277 case TYPE_DBCS_2ND:278 ulDBCSType = G_afLeadByte[*p2];279 // we can safely do the test here (and skip rechecking280 // the type) because c can't possibly be a leading byte281 // V0.9.20 (2002-07-22) [lafaix]282 if (*p2 == c)283 return (PSZ)p2;284 break;285 286 275 case TYPE_DBCS_1ST : 287 276 ulDBCSType = TYPE_DBCS_2ND; 288 277 break; 289 } 290 } 291 292 /* old code V0.9.20 (2002-07-22) [umoeller] 293 // we're on DBCS: 294 for (p2 = p; 295 *p2; 296 ++p2) 297 { 278 case TYPE_SBCS: 279 if (G_afLeadByte[*p2]) 280 ulDBCSType = TYPE_DBCS_1ST; 281 break; 282 } 283 284 if (ulDBCSType != TYPE_DBCS_1ST) { 298 285 if (*p2 == c) 299 {300 // match: return this only if it's SBCS;301 // if it's a DBCS lead char, skip it302 switch (ulDBCS = nlsQueryDBCSChar(p, p2 - p))303 {304 case TYPE_SBCS:305 286 return (PSZ)p2; 306 307 case TYPE_DBCS_1ST: 308 ++p2; 287 ulDBCSType = TYPE_SBCS; // Ensure next char checked for DBCS lead 309 288 } 310 } 311 } 312 */ 289 290 } // for 313 291 314 292 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.