]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update 'stpncpy' module from gnulib.
authorBruno Haible <bruno@clisp.org>
Wed, 12 Jan 2005 13:06:14 +0000 (13:06 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:02 +0000 (12:12 +0200)
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/lib/ChangeLog
gettext-tools/lib/Makefile.am
gettext-tools/lib/Makefile.msvc
gettext-tools/lib/Makefile.vms
gettext-tools/lib/stpncpy.c
gettext-tools/lib/stpncpy.h
gettext-tools/m4/ChangeLog
gettext-tools/m4/Makefile.am

index 86abc0bcc2eee6f016d707d0ae6bb1511c137058..3dee51f53890fd8bfbf2a57203e3f5598fdc24d2 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 0b574cc4873c6942358a58074db977de91e714ee..458d0015ed7966679f2cd73f145f0a485cf19571 100644 (file)
@@ -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
index ab799ef87bdbd27fc7af95d54ca6ec6c0709ef6b..0d26f05642214d3c7f2a7dcc530763af16ddcbf4 100644 (file)
@@ -1,3 +1,12 @@
+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.
index 8e60915af030ec10e5058a974b6442d1181ecb41..1f2df7bf85bacdb51162c065ba435d55c4c020de 100644 (file)
@@ -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 \
index 812f13e4c10c92c74c1659c8be17ddcb38370967..f606cd7b41c0ebcd5c8b8923e22a8aae1cb04eb1 100644 (file)
@@ -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
 
index 96a02d5ad8deb6b9551b58ba75dbdc0bec7904d0..e963897897d34c6e442d216c5a6b41f4092ccf25 100644 (file)
@@ -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
 
index 42e31ad0d68fa4cb286eca1de2b711149d8a402b..87e4382b54a369284460035a991491414a4b7374 100644 (file)
@@ -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.
 /* 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
index 6dc56d8c0736633ad825d4b24f1e328ae7c4ba65..6dc92a81324d993b9dc2ead31d4c69e3a2db47ab 100644 (file)
@@ -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);
index dbab0f22c9020dea4ae516dcbbaa6a09ffbd242b..757b99ea03f49a1a5931fbdb163a9991ed873b9f 100644 (file)
@@ -1,3 +1,8 @@
+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.
index e2fefa31c7c7054a3982e836e0d4823a087e463c..7df15893238a580f21dcd31b66da2a6695edc317 100644 (file)
@@ -83,6 +83,7 @@ siginfo.m4 \
 signalblocking.m4 \
 ssize_t.m4 \
 stdbool.m4 \
+stpncpy.m4 \
 strerror.m4 \
 strerror_r.m4 \
 tmpdir.m4 \