+2005-01-06 Bruno Haible <bruno@clisp.org>
+
+ * configure.ac: Invoke gl_FUNC_STPNCPY.
+
2005-01-06 Bruno Haible <bruno@clisp.org>
* configure.ac: Invoke gl_ERROR instead of gt_FUNC_ERROR_AT_LINE.
gl_FUNC_FNMATCH_POSIX
gl_GETOPT
gl_FUNC_EACCESS
+gl_FUNC_STPNCPY
gl_MBSWIDTH
gt_PREREQ_BACKUPFILE
AC_FUNC_VFORK
+2005-01-06 Bruno Haible <bruno@clisp.org>
+
+ * stpncpy.h: Update from gnulib.
+ * stpncpy.c: Update from gnulib with simplifications.
+ * Makefile.am (libgettextlib_la_SOURCES): Remove stpncpy.h, stpncpy.c.
+ (LIBADD_SOURCE): Add stpncpy.h, stpncpy.c.
+ * Makefile.msvc: Update.
+ * Makefie.vms: Update.
+
2005-01-06 Bruno Haible <bruno@clisp.org>
* error.h: Update from gnulib.
safe-read.h safe-read.c \
safe-write.h safe-write.c \
sh-quote.h sh-quote.c \
- stpncpy.h stpncpy.c \
strtoul.c \
tmpdir.h tmpdir.c \
ucs4-utf8.h ucs4-utf16.h \
relocatable.h relocatable.c \
setenv.h setenv.c unsetenv.c \
stpcpy.h stpcpy.c \
+ stpncpy.h stpncpy.c \
strcase.h strcasecmp.c strncasecmp.c \
strcspn.c \
strerror.c \
safe-read.obj \
safe-write.obj \
sh-quote.obj \
- stpncpy.obj \
strtoul.obj \
tmpdir.obj \
wait-process.obj \
relocatable.obj \
setenv.obj unsetenv.obj \
stpcpy.obj \
+ stpncpy.obj \
strcasecmp.obj strncasecmp.obj \
vasprintf.obj
sh-quote.obj : sh-quote.c
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c sh-quote.c
-stpncpy.obj : stpncpy.c
- $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c stpncpy.c
-
strtoul.obj : strtoul.c
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c strtoul.c
stpcpy.obj : stpcpy.c
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c stpcpy.c
+stpncpy.obj : stpncpy.c
+ $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c stpncpy.c
+
strcasecmp.obj : strcasecmp.c
$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c strcasecmp.c
safe-read.obj, \
safe-write.obj, \
sh-quote.obj, \
- stpncpy.obj, \
strtoul.obj, \
tmpdir.obj, \
wait-process.obj, \
mkdtemp.obj, \
relocatable.obj, \
stpcpy.obj, \
+ stpncpy.obj, \
vasprintf.obj
all : alloca.h,fnmatch.h,gettextlib.olb
sh-quote.obj : sh-quote.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) sh-quote.c
-stpncpy.obj : stpncpy.c
- $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) stpncpy.c
-
strtoul.obj : strtoul.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) strtoul.c
stpcpy.obj : stpcpy.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) stpcpy.c
+stpncpy.obj : stpncpy.c
+ $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) stpncpy.c
+
vasprintf.obj : vasprintf.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) vasprintf.c
-/* Copyright (C) 1993, 1995-1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-1997, 2002-2003, 2005 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
/* Specification. */
#include "stpncpy.h"
-#ifndef __GNU_LIBRARY__
-
-#ifdef _LIBC
-# include <string.h>
-#else
-# include <sys/types.h>
-/* We cannot generally use the name 'stpncpy' since AIX 4 defines an unusable
- variant of the function but we cannot use it. */
-# undef stpncpy
-# define stpncpy gnu_stpncpy
-#endif
-
#ifndef weak_alias
# define __stpncpy stpncpy
#endif
-/* Copy no more than N characters of SRC to DEST, returning the address of
- the terminating '\0' in DEST, if any, or else DEST + N. */
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+ last non-NUL byte written into DST. */
char *
__stpncpy (char *dest, const char *src, size_t n)
{
#ifdef weak_alias
weak_alias (__stpncpy, stpncpy)
#endif
-
-#endif
/* String copying.
- Copyright (C) 1995, 2001-2003 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
-#ifndef __GNU_LIBRARY__
+#if !HAVE_STPNCPY
-/* Copy no more than N characters of SRC to DST, returning the address of
- the last character written into DST. */
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+ last non-NUL byte written into DST. */
/* When not using the GNU libc we use the stpncpy implementation we
provide here. */
extern char *gnu_stpncpy (char *dst, const char *src, size_t n);
+2005-01-06 Bruno Haible <bruno@clisp.org>
+
+ * stpncpy.m4: New file, from gnulib.
+ * Makefile.am (EXTRA_DIST): Add it.
+
2005-01-06 Bruno Haible <bruno@clisp.org>
* error.m4: Upgrade from gnulib.
signalblocking.m4 \
ssize_t.m4 \
stdbool.m4 \
+stpncpy.m4 \
strerror.m4 \
strerror_r.m4 \
tmpdir.m4 \