scripts/addToolsVersion: properly handle .in vs. .in.2
While most components have their version in the .in file, some
have it in the .in.2 (eg. elf2flt).
Currently, to handle this case, we indiscriminately munge both files,
but this is wrong: in the elf2flt case, if we add a binutils version,
we do not want it to be added to elf2flt, and conversely.
So, for each tool, we need to explicitly know what file to munge.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
1 http://sourceware.org/ml/libc-hacker/2002-11/msg00071.html
3 When fnmatch detects an invalid multibyte character it should fall back to
4 single byte matching, so that "*" has a chance to match such a string.
8 2005-04-12 Andreas Schwab <schwab@suse.de>
10 * posix/fnmatch.c (fnmatch): If conversion to wide character
11 fails fall back to single byte matching.
13 Index: posix/fnmatch.c
14 ===================================================================
16 diff -durN glibc-2.12.1.orig/posix/fnmatch.c glibc-2.12.1/posix/fnmatch.c
17 --- glibc-2.12.1.orig/posix/fnmatch.c 2007-07-28 22:35:00.000000000 +0200
18 +++ glibc-2.12.1/posix/fnmatch.c 2009-11-13 00:50:39.000000000 +0100
21 if (__builtin_expect (MB_CUR_MAX, 1) != 1)
23 + const char *orig_pattern = pattern;
28 wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
29 n = mbsrtowcs (wstring, &p, n + 1, &ps);
30 if (__builtin_expect (n == (size_t) -1, 0))
32 - XXX Do we have to set `errno' to something which mbsrtows hasn't
35 + /* Something wrong. Fall back to single byte matching. */
36 + goto try_singlebyte;
39 memset (&ps, '\0', sizeof (ps));
42 n = mbsrtowcs (NULL, &string, 0, &ps);
43 if (__builtin_expect (n == (size_t) -1, 0))
45 - XXX Do we have to set `errno' to something which mbsrtows hasn't
48 + /* Something wrong. Fall back to single byte matching. */
49 + goto try_singlebyte;
50 wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
51 assert (mbsinit (&ps));
52 (void) mbsrtowcs (wstring, &string, n + 1, &ps);
55 return internal_fnwmatch (wpattern, wstring, wstring + n,
56 flags & FNM_PERIOD, flags, NULL);
59 + pattern = orig_pattern;
61 # endif /* mbstate_t and mbsrtowcs or _LIBC. */