source:
scripts/fetch/eglibc/2.10.1/15-fnpatch.patch@
ed17c82
Last change on this file since ed17c82 was b17b911f, checked in by , 15 years ago | |
---|---|
|
|
File size: 1.7 KB |
-
posix/fnmatch.c
2005-04-12 Andreas Schwab <schwab@suse.de> * posix/fnmatch.c (fnmatch): If conversion to wide character fails fall back to single byte matching.
old new 327 327 # if HANDLE_MULTIBYTE 328 328 if (__builtin_expect (MB_CUR_MAX, 1) != 1) 329 329 { 330 const char *orig_pattern = pattern; 330 331 mbstate_t ps; 331 332 size_t n; 332 333 const char *p; … … 378 379 wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t)); 379 380 n = mbsrtowcs (wstring, &p, n + 1, &ps); 380 381 if (__builtin_expect (n == (size_t) -1, 0)) 381 /* Something wrong. 382 XXX Do we have to set `errno' to something which mbsrtows hasn't 383 already done? */ 384 return -1; 382 /* Something wrong. Fall back to single byte matching. */ 383 goto try_singlebyte; 385 384 if (p) 386 385 memset (&ps, '\0', sizeof (ps)); 387 386 } … … 389 388 { 390 389 n = mbsrtowcs (NULL, &string, 0, &ps); 391 390 if (__builtin_expect (n == (size_t) -1, 0)) 392 /* Something wrong. 393 XXX Do we have to set `errno' to something which mbsrtows hasn't 394 already done? */ 395 return -1; 391 /* Something wrong. Fall back to single byte matching. */ 392 goto try_singlebyte; 396 393 wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t)); 397 394 assert (mbsinit (&ps)); 398 395 (void) mbsrtowcs (wstring, &string, n + 1, &ps); … … 400 397 401 398 return internal_fnwmatch (wpattern, wstring, wstring + n, 402 399 flags & FNM_PERIOD, flags, NULL); 400 401 try_singlebyte: 402 pattern = orig_pattern; 403 403 } 404 404 # endif /* mbstate_t and mbsrtowcs or _LIBC. */ 405 405
Note:
See TracBrowser
for help on using the repository browser.