+2005-07-24 Ulrich Drepper <drepper@redhat.com>
+
+ * string/test-memset.c (test_main): Use negative byte value is
+ test.
+
+ * string/test-memset.c (do_one_test): Compare effect of call, not
+ only return value.
+ Add a few casts to avoid warnings.
+
+2005-07-24 SUGIOKA Toshinobu <sugioka@itonet.co.jp>
+
+ * sysdeps/sh/memset.S (memset): Correct 2nd argument handling.
+
+2005-07-24 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #1125]
+ * posix/Makefile (tests): Add tst-execvp4.
+ * posix/tst-execvp4.c: New file.
+
+2005-07-24 Jakub Jelinek <jakub@redhat.com>
+
+ [BZ #1125]
+ * posix/execvp.c (execvp): Change path_malloc to
+ char *, free that pointer on failure.
+
+2005-07-24 Ulrich Drepper <drepper@redhat.com>
+
+ * wcsmbs/bits/wchar2.h: Use __FILE not FILE.
+ * wcsmbs/Makefile: Add rules to build and run tst-wchar-h.
+ * wcsmbs/tst-wchar-h.c: New file.
+
+2005-07-22 Ulrich Drepper <drepper@redhat.com>
+
+ * stdio-common/fxprintf.c (__fxprintf): Define variable more local.
+
2005-07-22 Jakub Jelinek <jakub@redhat.com>
* wcsmbs/bits/wchar2.h (__vfwprintf_chk, __vwprintf_chk): Use
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-fc4
-fedora-sync-date := 2005-07-22 04:33 UTC
-fedora-sync-tag := fedora-glibc-20050722T0433
+fedora-sync-date := 2005-07-25 06:27 UTC
+fedora-sync-tag := fedora-glibc-20050725T0627
tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
- tst-execvp3
+ tst-execvp3 tst-execvp4
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
else
{
char *path = getenv ("PATH");
- bool path_malloc = false;
+ char *path_malloc = NULL;
if (path == NULL)
{
/* There is no `PATH' in the environment.
return -1;
path[0] = ':';
(void) confstr (_CS_PATH, path + 1, len);
- path_malloc = true;
+ path_malloc = path;
}
size_t len = strlen (file) + 1;
char *name = malloc (pathlen + len + 1);
if (name == NULL)
{
- if (path_malloc)
- free (path);
+ free (path_malloc);
return -1;
}
/* Copy the file name at the top. */
free (script_argv);
free (name - pathlen);
- if (path_malloc)
- free (path);
+ free (path_malloc);
}
/* Return the error from the last attempt (probably ENOENT). */
--- /dev/null
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+static int
+do_test (void)
+{
+ char buf[40] = "/usr/bin/does-not-exist";
+ size_t stemlen = strlen (buf);
+ struct stat64 st;
+ int cnt = 0;
+ while (stat64 (buf, &st) != -1 || errno != ENOENT
+ || stat64 (buf + 4, &st) != -1 || errno != ENOENT)
+ {
+ if (cnt++ == 100)
+ {
+ puts ("cannot find a unique file name");
+ return 0;
+ }
+
+ strcpy (buf + stemlen, ".XXXXXX");
+ mktemp (buf);
+ }
+
+ unsetenv ("PATH");
+ char *argv[] = { buf + 9, NULL };
+ execvp (argv[0], argv);
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
int res;
if (_IO_fwide (fp, 0) > 0)
{
- size_t len = strlen (fmt) + 1, i;
+ size_t len = strlen (fmt) + 1;
wchar_t wfmt[len];
- for (i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
{
assert (isascii (fmt[i]));
wfmt[i] = fmt[i];
/* Test and measure memset functions.
- Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
do_one_test (impl_t *impl, char *s, int c, size_t n)
{
char *res = CALL (impl, s, c, n);
- if (res != s)
+ char tstbuf[n];
+ if (res != s
+ || simple_memset (tstbuf, c, n) != tstbuf
+ || memcmp (s, tstbuf, n) != 0)
{
- error (0, 0, "Wrong result in function %s %p != %p", impl->name,
- res, s);
+ error (0, 0, "Wrong result in function %s", impl->name);
ret = 1;
return;
}
printf ("Length %4zd, alignment %2zd, c %2d:", len, align, c);
FOR_EACH_IMPL (impl, 0)
- do_one_test (impl, buf1 + align, c, len);
+ do_one_test (impl, (char *) buf1 + align, c, len);
if (HP_TIMING_AVAIL)
putchar ('\n');
if (p[i + align] == c)
p[i + align] = o;
}
- res = CALL (impl, p + align, c, len);
+ res = (unsigned char *) CALL (impl, (char *) p + align, c, len);
if (res != p + align)
{
error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd) %p != %p",
printf ("\t%s", impl->name);
putchar ('\n');
- for (c = 0; c <= 65; c += 65)
+ for (c = -65; c <= 130; c += 65)
{
for (i = 0; i < 18; ++i)
do_test (0, c, 1 << i);
bt.s L_byte_loop_init
mov r4,r7
+ extu.b r5,r5
swap.b r5,r1
or r1,r5
swap.w r5,r1
wcsmbsload mbsrtowcs_l
tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
- tst-wcrtomb tst-wcpncpy tst-mbsrtowcs
+ tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h
include ../Rules
CFLAGS-wcstod_l.c = $(strtox-CFLAGS)
CFLAGS-wcstold_l.c = $(strtox-CFLAGS)
CFLAGS-wcstof_l.c = $(strtox-CFLAGS)
+CFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
tst-btowc-ENV = LOCPATH=$(common-objpfx)localedata
tst-mbrtowc-ENV = LOCPATH=$(common-objpfx)localedata
#if __USE_FORTIFY_LEVEL > 1
-extern int __fwprintf_chk (FILE *__restrict __stream, int __flag,
+extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
__const wchar_t *__restrict __format, ...);
extern int __wprintf_chk (int __flag, __const wchar_t *__restrict __format,
...);
-extern int __vfwprintf_chk (FILE *__restrict __stream, int __flag,
+extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
__const wchar_t *__restrict __format,
__gnuc_va_list __ap);
extern int __vwprintf_chk (int __flag, __const wchar_t *__restrict __format,
#endif
extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
- FILE *__restrict __stream) __wur;
+ __FILE *__restrict __stream) __wur;
extern wchar_t *__REDIRECT (__fgetws_alias,
(wchar_t *__restrict __s, int __n,
- FILE *__restrict __stream), fgetws) __wur;
+ __FILE *__restrict __stream), fgetws) __wur;
extern __always_inline __wur wchar_t *
-fgetws (wchar_t *__restrict __s, int __n, FILE *__restrict __stream)
+fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
{
if (__bos (__s) != (size_t) -1
&& (!__builtin_constant_p (__n) || (size_t) __n > __bos (__s)))
#ifdef __USE_GNU
extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
- int __n, FILE *__restrict __stream)
+ int __n, __FILE *__restrict __stream)
__wur;
extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
(wchar_t *__restrict __s, int __n,
- FILE *__restrict __stream), fgetws_unlocked)
+ __FILE *__restrict __stream), fgetws_unlocked)
__wur;
extern __always_inline __wur wchar_t *
-fgetws_unlocked (wchar_t *__restrict __s, int __n, FILE *__restrict __stream)
+fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
{
if (__bos (__s) != (size_t) -1
&& (!__builtin_constant_p (__n) || (size_t) __n > __bos (__s)))
--- /dev/null
+#include <stdlib.h>
+#include <wchar.h>
+
+int
+main (void)
+{
+ mbstate_t x;
+ return sizeof (x) - sizeof (mbstate_t);
+}