]>
Commit | Line | Data |
---|---|---|
e57ca989 | 1 | 2001-11-29 Jakub Jelinek <jakub@redhat.com> |
2 | ||
3 | * sysdeps/generic/glob.c (next_brace_sub): Return NULL if braces | |
4 | don't match, fix {{a,b},c} globbing, clean up. | |
5 | Patch by Flavio Veloso <flaviovs@magnux.com>. | |
6 | * posix/globtest.sh: Add new tests. | |
7 | ||
8 | 2001-11-28 Jakub Jelinek <jakub@redhat.com> | |
9 | ||
10 | * sysdeps/sparc/fpu/bits/mathinline.h (__signbitf, __signbit, | |
11 | __signbitl): Only define for ISO C99. | |
12 | ||
13 | 2001-11-26 Ulrich Drepper <drepper@redhat.com> | |
14 | ||
15 | * stdio-common/vfscanf.c: If incomplete nan of inf(inity) strings | |
16 | are found call conv_error and not input_error [PR libc/2669]. | |
17 | ||
18 | 2001-11-02 Jakub Jelinek <jakub@redhat.com> | |
19 | ||
20 | * string/bits/string2.h (__strndup): If n is smaller than len, set | |
21 | len to n + 1. | |
22 | * string/tester.c (test_strndup): New function. | |
23 | (main): Call it. | |
24 | ||
25 | 2001-10-31 Ulrich Drepper <drepper@redhat.com> | |
26 | ||
27 | * elf/dl-load.c (_dl_map_object): Make code a bit more compact by | |
28 | avoiding unnecessary duplication. | |
29 | ||
30 | 2001-10-31 Jakub Jelinek <jakub@redhat.com> | |
31 | ||
32 | * elf/dl-load.c (_dl_map_object): If library was found using | |
33 | LD_LIBRARY_PATH, don't try RUNPATH list. | |
34 | ||
35 | 2001-10-26 Ulrich Drepper <drepper@redhat.com> | |
36 | ||
37 | * posix/fnmatch_loop.c: Recognize - at end of bracket expression | |
38 | correctly. | |
39 | * posix/tst-fnmatch.input: Add tests for - at beginning and end of | |
40 | bracket expression. | |
41 | ||
42 | 2001-10-24 H.J. Lu <hjl@gnu.org> | |
43 | ||
44 | * sysdeps/generic/bits/dlfcn.h (DL_CALL_FCT): Cast to void *. | |
45 | Use __BEGIN_DECLS/__END_DECLS around prototypes. | |
46 | ||
47 | 2001-10-26 Ulrich Drepper <drepper@redhat.com> | |
48 | ||
49 | * resolv/gethnamaddr.c (gethostbyaddr): Use ip6.addr for reverse | |
50 | lookup not ip6.int. | |
51 | * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr_r): Likewise. | |
52 | Reported by Martin.v.Loewis@t-online.de [PR libc/2598]. | |
53 | ||
54 | 2001-10-04 Ben Collins <bcollins@debian.org> | |
55 | ||
56 | * sysdeps/generic/inttypes.h: Fix typo (define, not defined) in | |
57 | decleration of __need_wchar_t. | |
58 | ||
59 | --- libc/sysdeps/sparc/fpu/bits/mathinline.h 2001/07/06 04:56:04 1.8 | |
60 | +++ libc/sysdeps/sparc/fpu/bits/mathinline.h 2001/11/28 15:19:39 | |
61 | @@ -101,7 +101,10 @@ | |
62 | /* The gcc, version 2.7 or below, has problems with all this inlining | |
63 | code. So disable it for this version of the compiler. */ | |
64 | # if __GNUC_PREREQ (2, 8) | |
65 | - /* Test for negative number. Used in the signbit() macro. */ | |
66 | + | |
67 | +#if defined __USE_ISOC99 | |
68 | + | |
69 | +/* Test for negative number. Used in the signbit() macro. */ | |
70 | __MATH_INLINE int | |
71 | __signbitf (float __x) __THROW | |
72 | { | |
73 | @@ -142,6 +145,8 @@ __signbitl (long double __x) __THROW | |
74 | ||
75 | #endif /* sparc64 */ | |
76 | ||
77 | +#endif /* __USE_ISOC99 */ | |
78 | + | |
79 | #ifndef __NO_MATH_INLINES | |
80 | ||
81 | __MATH_INLINE double | |
82 | @@ -171,7 +176,7 @@ sqrtl(long double __x) __THROW | |
83 | } | |
84 | #endif /* sparc64 */ | |
85 | ||
86 | -#endif | |
87 | +#endif /* !__NO_MATH_INLINES */ | |
88 | ||
89 | /* This code is used internally in the GNU libc. */ | |
90 | #ifdef __LIBC_INTERNAL_MATH_INLINES | |
91 | --- libc/stdio-common/vfscanf.c 2001/08/24 03:21:13 1.96 | |
92 | +++ libc/stdio-common/vfscanf.c 2001/11/27 02:18:20 1.97 | |
93 | @@ -1596,7 +1596,8 @@ __vfscanf (FILE *s, const char *format, | |
94 | if (width == 0 || inchar () == EOF) | |
95 | /* EOF is only an input error before we read any chars. */ | |
96 | conv_error (); | |
97 | - if (! ISDIGIT (c) && TOLOWER (c) != L_('i')) | |
98 | + if (! ISDIGIT (c) && TOLOWER (c) != L_('i') | |
99 | + && TOLOWER (c) != L_('n')) | |
100 | { | |
101 | #ifdef COMPILE_WSCANF | |
102 | if (c != decimal) | |
103 | @@ -1654,12 +1655,12 @@ __vfscanf (FILE *s, const char *format, | |
104 | /* Maybe "nan". */ | |
105 | ADDW (c); | |
106 | if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('a')) | |
107 | - input_error (); | |
108 | + conv_error (); | |
109 | if (width > 0) | |
110 | --width; | |
111 | ADDW (c); | |
112 | if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n')) | |
113 | - input_error (); | |
114 | + conv_error (); | |
115 | if (width > 0) | |
116 | --width; | |
117 | ADDW (c); | |
118 | @@ -1671,12 +1672,12 @@ __vfscanf (FILE *s, const char *format, | |
119 | /* Maybe "inf" or "infinity". */ | |
120 | ADDW (c); | |
121 | if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n')) | |
122 | - input_error (); | |
123 | + conv_error (); | |
124 | if (width > 0) | |
125 | --width; | |
126 | ADDW (c); | |
127 | if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('f')) | |
128 | - input_error (); | |
129 | + conv_error (); | |
130 | if (width > 0) | |
131 | --width; | |
132 | ADDW (c); | |
133 | @@ -1691,25 +1692,25 @@ __vfscanf (FILE *s, const char *format, | |
134 | ADDW (c); | |
135 | if (width == 0 || inchar () == EOF | |
136 | || TOLOWER (c) != L_('n')) | |
137 | - input_error (); | |
138 | + conv_error (); | |
139 | if (width > 0) | |
140 | --width; | |
141 | ADDW (c); | |
142 | if (width == 0 || inchar () == EOF | |
143 | || TOLOWER (c) != L_('i')) | |
144 | - input_error (); | |
145 | + conv_error (); | |
146 | if (width > 0) | |
147 | --width; | |
148 | ADDW (c); | |
149 | if (width == 0 || inchar () == EOF | |
150 | || TOLOWER (c) != L_('t')) | |
151 | - input_error (); | |
152 | + conv_error (); | |
153 | if (width > 0) | |
154 | --width; | |
155 | ADDW (c); | |
156 | if (width == 0 || inchar () == EOF | |
157 | || TOLOWER (c) != L_('y')) | |
158 | - input_error (); | |
159 | + conv_error (); | |
160 | if (width > 0) | |
161 | --width; | |
162 | ADDW (c); | |
163 | --- libc/string/bits/string2.h 2001/10/07 20:13:12 1.63 | |
164 | +++ libc/string/bits/string2.h 2001/11/03 09:03:47 1.64 | |
165 | @@ -1216,7 +1216,7 @@ extern char *__strndup (__const char *__ | |
166 | size_t __n = (n); \ | |
167 | char *__retval; \ | |
168 | if (__n < __len) \ | |
169 | - __len = __n; \ | |
170 | + __len = __n + 1; \ | |
171 | __retval = (char *) malloc (__len); \ | |
172 | if (__retval != NULL) \ | |
173 | { \ | |
174 | --- libc/string/tester.c 2001/08/24 23:51:11 1.39 | |
175 | +++ libc/string/tester.c 2001/11/03 09:04:20 1.40 | |
176 | @@ -1257,6 +1257,30 @@ test_bzero (void) | |
177 | } | |
178 | ||
179 | static void | |
180 | +test_strndup (void) | |
181 | +{ | |
182 | + char *p, *q; | |
183 | + it = "strndup"; | |
184 | + p = strndup("abcdef", 12); | |
185 | + check(p != NULL, 1); | |
186 | + if (p != NULL) | |
187 | + { | |
188 | + equal(p, "abcdef", 2); | |
189 | + q = strndup(p + 1, 2); | |
190 | + check(q != NULL, 3); | |
191 | + if (q != NULL) | |
192 | + equal(q, "bc", 4); | |
193 | + free (q); | |
194 | + } | |
195 | + free (p); | |
196 | + p = strndup("abc def", 3); | |
197 | + check(p != NULL, 5); | |
198 | + if (p != NULL) | |
199 | + equal(p, "abc", 6); | |
200 | + free (p); | |
201 | +} | |
202 | + | |
203 | +static void | |
204 | test_bcmp (void) | |
205 | { | |
206 | it = "bcmp"; | |
207 | @@ -1381,6 +1405,9 @@ main (void) | |
208 | ||
209 | /* bcmp - somewhat like memcmp. */ | |
210 | test_bcmp (); | |
211 | + | |
212 | + /* strndup. */ | |
213 | + test_strndup (); | |
214 | ||
215 | /* strerror - VERY system-dependent. */ | |
216 | test_strerror (); | |
217 | --- libc/elf/dl-load.c 2001/09/19 03:18:40 1.175 | |
218 | +++ libc/elf/dl-load.c 2001/11/01 04:43:01 1.176 | |
219 | @@ -1608,7 +1608,8 @@ _dl_map_object (struct link_map *loader, | |
220 | &realname, &fb); | |
221 | ||
222 | /* Look at the RUNPATH information for this binary. */ | |
223 | - if (loader != NULL && loader->l_runpath_dirs.dirs != (void *) -1) | |
224 | + if (fd == -1 && loader != NULL | |
225 | + && loader->l_runpath_dirs.dirs != (void *) -1) | |
226 | { | |
227 | if (loader->l_runpath_dirs.dirs == NULL) | |
228 | { | |
229 | @@ -1622,13 +1623,10 @@ _dl_map_object (struct link_map *loader, | |
230 | + loader->l_info[DT_RUNPATH]->d_un.d_val); | |
231 | decompose_rpath (&loader->l_runpath_dirs, | |
232 | (const char *) ptrval, loader, "RUNPATH"); | |
233 | - | |
234 | - if (loader->l_runpath_dirs.dirs != (void *) -1) | |
235 | - fd = open_path (name, namelen, preloaded, | |
236 | - &loader->l_runpath_dirs, &realname, &fb); | |
237 | } | |
238 | } | |
239 | - else if (loader->l_runpath_dirs.dirs != (void *) -1) | |
240 | + | |
241 | + if (loader->l_runpath_dirs.dirs != (void *) -1) | |
242 | fd = open_path (name, namelen, preloaded, | |
243 | &loader->l_runpath_dirs, &realname, &fb); | |
244 | } | |
245 | --- libc/posix/fnmatch_loop.c 2001/08/10 05:55:16 1.28 | |
246 | +++ libc/posix/fnmatch_loop.c 2001/10/27 00:37:40 1.29 | |
247 | @@ -592,7 +592,8 @@ FCT (pattern, string, string_end, no_lea | |
248 | /* We have to handling the symbols differently in | |
249 | ranges since then the collation sequence is | |
250 | important. */ | |
251 | - is_range = *p == L('-') && p[1] != L('\0'); | |
252 | + is_range = (*p == L('-') && p[1] != L('\0') | |
253 | + && p[1] != L(']')); | |
254 | ||
255 | if (!is_range && c == fn) | |
256 | goto matched; | |
257 | --- libc/posix/tst-fnmatch.input 2001/07/06 04:55:38 1.12 | |
258 | +++ libc/posix/tst-fnmatch.input 2001/10/27 02:37:27 1.13 | |
259 | @@ -381,6 +381,14 @@ C "a" "a/" NOMATCH | |
260 | C "a/" "a" NOMATCH PATHNAME | |
261 | C "//a" "/a" NOMATCH PATHNAME | |
262 | C "/a" "//a" NOMATCH PATHNAME | |
263 | +C "az" "[a-]z" 0 | |
264 | +C "bz" "[ab-]z" 0 | |
265 | +C "cz" "[ab-]z" NOMATCH | |
266 | +C "-z" "[ab-]z" 0 | |
267 | +C "az" "[-a]z" 0 | |
268 | +C "bz" "[-ab]z" 0 | |
269 | +C "cz" "[-ab]z" NOMATCH | |
270 | +C "-z" "[-ab]z" 0 | |
271 | ||
272 | # Following are tests outside the scope of IEEE 2003.2 since they are using | |
273 | # locales other than the C locale. The main focus of the tests is on the | |
274 | --- libc/sysdeps/generic/bits/dlfcn.h 2001/07/06 04:55:50 1.7 | |
275 | +++ libc/sysdeps/generic/bits/dlfcn.h 2001/10/27 00:03:32 1.8 | |
276 | @@ -1,5 +1,5 @@ | |
277 | /* System dependent definitions for run-time dynamic loading. | |
278 | - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. | |
279 | + Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. | |
280 | This file is part of the GNU C Library. | |
281 | ||
282 | The GNU C Library is free software; you can redistribute it and/or | |
283 | @@ -52,8 +52,13 @@ | |
284 | foo = DL_CALL_FCT (fctp, (arg1, arg2)); | |
285 | */ | |
286 | # define DL_CALL_FCT(fctp, args) \ | |
287 | - (_dl_mcount_wrapper_check (fctp), (*(fctp)) args) | |
288 | + (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args) | |
289 | ||
290 | +__BEGIN_DECLS | |
291 | + | |
292 | /* This function calls the profiling functions. */ | |
293 | extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; | |
294 | + | |
295 | +__END_DECLS | |
296 | + | |
297 | #endif | |
298 | --- libc/resolv/gethnamaddr.c 2001/09/19 03:05:12 1.36 | |
299 | +++ libc/resolv/gethnamaddr.c 2001/10/26 23:49:48 1.37 | |
300 | @@ -690,7 +690,7 @@ gethostbyaddr(addr, len, af) | |
301 | uaddr[n] & 0xf, | |
302 | (uaddr[n] >> 4) & 0xf)); | |
303 | } | |
304 | - strcpy(qp, "ip6.int"); | |
305 | + strcpy(qp, "ip6.arpa"); | |
306 | break; | |
307 | default: | |
308 | abort(); | |
309 | --- libc/resolv/nss_dns/dns-host.c 2001/08/14 23:27:27 1.28 | |
310 | +++ libc/resolv/nss_dns/dns-host.c 2001/10/26 23:49:07 1.29 | |
311 | @@ -282,7 +282,7 @@ _nss_dns_gethostbyaddr_r (const void *ad | |
312 | qp = qbuf; | |
313 | for (n = IN6ADDRSZ - 1; n >= 0; n--) | |
314 | qp += sprintf (qp, "%x.%x.", uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf); | |
315 | - strcpy (qp, "ip6.int"); | |
316 | + strcpy (qp, "ip6.arpa"); | |
317 | break; | |
318 | default: | |
319 | /* Cannot happen. */ | |
320 | --- libc/posix/globtest.sh.jj Thu Aug 23 18:48:53 2001 | |
321 | +++ libc/posix/globtest.sh Thu Nov 29 13:32:05 2001 | |
322 | @@ -146,6 +146,32 @@ if test $failed -ne 0; then | |
323 | result=1 | |
324 | fi | |
325 | ||
326 | +failed=0 | |
327 | +${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \ | |
328 | +${common_objpfx}posix/globtest -b "$testdir" "{file{1,2},-file3}" | | |
329 | +sort > $testout | |
330 | +cat <<"EOF" | cmp - $testout >> $logfile || failed=1 | |
331 | +`-file3' | |
332 | +`file1' | |
333 | +`file2' | |
334 | +EOF | |
335 | +if test $failed -ne 0; then | |
336 | + echo "Braces test 2 failed" >> $logfile | |
337 | + result=1 | |
338 | +fi | |
339 | + | |
340 | +failed=0 | |
341 | +${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \ | |
342 | +${common_objpfx}posix/globtest -b "$testdir" "{" | | |
343 | +sort > $testout | |
344 | +cat <<"EOF" | cmp - $testout >> $logfile || failed=1 | |
345 | +GLOB_NOMATCH | |
346 | +EOF | |
347 | +if test $failed -ne 0; then | |
348 | + echo "Braces test 3 failed" >> $logfile | |
349 | + result=1 | |
350 | +fi | |
351 | + | |
352 | # Test NOCHECK | |
353 | failed=0 | |
354 | ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \ | |
355 | --- libc/sysdeps/generic/glob.c.jj Thu Aug 23 18:49:29 2001 | |
356 | +++ libc/sysdeps/generic/glob.c Thu Nov 29 13:17:21 2001 | |
357 | @@ -355,42 +355,14 @@ static | |
358 | inline | |
359 | #endif | |
360 | const char * | |
361 | -next_brace_sub (begin) | |
362 | - const char *begin; | |
363 | +next_brace_sub (cp) | |
364 | + const char *cp; | |
365 | { | |
366 | unsigned int depth = 0; | |
367 | - const char *cp = begin; | |
368 | - | |
369 | - while (1) | |
370 | - { | |
371 | - if (depth == 0) | |
372 | - { | |
373 | - if (*cp != ',' && *cp != '}' && *cp != '\0') | |
374 | - { | |
375 | - if (*cp == '{') | |
376 | - ++depth; | |
377 | - ++cp; | |
378 | - continue; | |
379 | - } | |
380 | - } | |
381 | - else | |
382 | - { | |
383 | - while (*cp != '\0' && (*cp != '}' || depth > 0)) | |
384 | - { | |
385 | - if (*cp == '}') | |
386 | - --depth; | |
387 | - ++cp; | |
388 | - } | |
389 | - if (*cp == '\0') | |
390 | - /* An incorrectly terminated brace expression. */ | |
391 | - return NULL; | |
392 | - | |
393 | - continue; | |
394 | - } | |
395 | - break; | |
396 | - } | |
397 | - | |
398 | - return cp; | |
399 | + while (*cp != '\0' && (*cp != '}' || depth--) && (*cp != ',' || depth)) | |
400 | + if (*cp++ == '{') | |
401 | + depth++; | |
402 | + return *cp != '\0' ? cp : NULL; | |
403 | } | |
404 | ||
405 | #endif /* !GLOB_ONLY_P */ |