summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-01-12 13:06:14 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:02 +0200
commit159ddbcb64735a222341c00089417c2fd47d8015 (patch)
treedbd449955bf0db1acc334b9a5244f5a6ddb26f5a
parent9dab5392ea01fd6e8e793558ebced79c285775a4 (diff)
downloadexternal_gettext-159ddbcb64735a222341c00089417c2fd47d8015.zip
external_gettext-159ddbcb64735a222341c00089417c2fd47d8015.tar.gz
external_gettext-159ddbcb64735a222341c00089417c2fd47d8015.tar.bz2
Update 'stpncpy' module from gnulib.
-rw-r--r--gettext-tools/ChangeLog4
-rw-r--r--gettext-tools/configure.ac1
-rw-r--r--gettext-tools/lib/ChangeLog9
-rw-r--r--gettext-tools/lib/Makefile.am2
-rw-r--r--gettext-tools/lib/Makefile.msvc8
-rw-r--r--gettext-tools/lib/Makefile.vms8
-rw-r--r--gettext-tools/lib/stpncpy.c20
-rw-r--r--gettext-tools/lib/stpncpy.h8
-rw-r--r--gettext-tools/m4/ChangeLog5
-rw-r--r--gettext-tools/m4/Makefile.am1
10 files changed, 36 insertions, 30 deletions
diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog
index 86abc0b..3dee51f 100644
--- a/gettext-tools/ChangeLog
+++ b/gettext-tools/ChangeLog
@@ -1,5 +1,9 @@
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.
* Makefile.am (config.h_vms, config.h.msvc): Remove setting of
HAVE_DECL_STRERROR.
diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac
index 0b574cc..458d001 100644
--- a/gettext-tools/configure.ac
+++ b/gettext-tools/configure.ac
@@ -131,6 +131,7 @@ gl_EXITFAIL
gl_FUNC_FNMATCH_POSIX
gl_GETOPT
gl_FUNC_EACCESS
+gl_FUNC_STPNCPY
gl_MBSWIDTH
gt_PREREQ_BACKUPFILE
AC_FUNC_VFORK
diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog
index ab799ef..0d26f05 100644
--- a/gettext-tools/lib/ChangeLog
+++ b/gettext-tools/lib/ChangeLog
@@ -1,5 +1,14 @@
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.
* error.c: Update from gnulib.
* Makefile.am (libgettextlib_la_SOURCES): Remove error.h, error.c.
diff --git a/gettext-tools/lib/Makefile.am b/gettext-tools/lib/Makefile.am
index 8e60915..1f2df7b 100644
--- a/gettext-tools/lib/Makefile.am
+++ b/gettext-tools/lib/Makefile.am
@@ -69,7 +69,6 @@ libgettextlib_la_SOURCES = \
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 \
@@ -99,6 +98,7 @@ LIBADD_SOURCE = \
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 \
diff --git a/gettext-tools/lib/Makefile.msvc b/gettext-tools/lib/Makefile.msvc
index 812f13e..f606cd7 100644
--- a/gettext-tools/lib/Makefile.msvc
+++ b/gettext-tools/lib/Makefile.msvc
@@ -113,7 +113,6 @@ OBJECTS = \
safe-read.obj \
safe-write.obj \
sh-quote.obj \
- stpncpy.obj \
strtoul.obj \
tmpdir.obj \
wait-process.obj \
@@ -131,6 +130,7 @@ OBJECTS = \
relocatable.obj \
setenv.obj unsetenv.obj \
stpcpy.obj \
+ stpncpy.obj \
strcasecmp.obj strncasecmp.obj \
vasprintf.obj
@@ -243,9 +243,6 @@ safe-write.obj : safe-write.c
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
@@ -303,6 +300,9 @@ unsetenv.obj : unsetenv.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
diff --git a/gettext-tools/lib/Makefile.vms b/gettext-tools/lib/Makefile.vms
index 96a02d5..e963897 100644
--- a/gettext-tools/lib/Makefile.vms
+++ b/gettext-tools/lib/Makefile.vms
@@ -71,7 +71,6 @@ OBJECTS = \
safe-read.obj, \
safe-write.obj, \
sh-quote.obj, \
- stpncpy.obj, \
strtoul.obj, \
tmpdir.obj, \
wait-process.obj, \
@@ -88,6 +87,7 @@ OBJECTS = \
mkdtemp.obj, \
relocatable.obj, \
stpcpy.obj, \
+ stpncpy.obj, \
vasprintf.obj
all : alloca.h,fnmatch.h,gettextlib.olb
@@ -204,9 +204,6 @@ safe-write.obj : safe-write.c
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
@@ -258,6 +255,9 @@ relocatable.obj : relocatable.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
diff --git a/gettext-tools/lib/stpncpy.c b/gettext-tools/lib/stpncpy.c
index 42e31ad..87e4382 100644
--- a/gettext-tools/lib/stpncpy.c
+++ b/gettext-tools/lib/stpncpy.c
@@ -1,4 +1,4 @@
-/* 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.
@@ -27,24 +27,12 @@
/* 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)
{
@@ -105,5 +93,3 @@ __stpncpy (char *dest, const char *src, size_t n)
#ifdef weak_alias
weak_alias (__stpncpy, stpncpy)
#endif
-
-#endif
diff --git a/gettext-tools/lib/stpncpy.h b/gettext-tools/lib/stpncpy.h
index 6dc56d8..6dc92a8 100644
--- a/gettext-tools/lib/stpncpy.h
+++ b/gettext-tools/lib/stpncpy.h
@@ -1,5 +1,5 @@
/* 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
@@ -26,10 +26,10 @@ extern "C" {
#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);
diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog
index dbab0f2..757b99e 100644
--- a/gettext-tools/m4/ChangeLog
+++ b/gettext-tools/m4/ChangeLog
@@ -1,5 +1,10 @@
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.
2005-01-06 Bruno Haible <bruno@clisp.org>
diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am
index e2fefa3..7df1589 100644
--- a/gettext-tools/m4/Makefile.am
+++ b/gettext-tools/m4/Makefile.am
@@ -83,6 +83,7 @@ siginfo.m4 \
signalblocking.m4 \
ssize_t.m4 \
stdbool.m4 \
+stpncpy.m4 \
strerror.m4 \
strerror_r.m4 \
tmpdir.m4 \