gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gsasl branch, master, updated. gsasl-1-5-1-2-gd4e6086


From: Simon Josefsson
Subject: [SCM] GNU gsasl branch, master, updated. gsasl-1-5-1-2-gd4e6086
Date: Sun, 25 Apr 2010 14:43:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gsasl".

http://git.savannah.gnu.org/cgit/gsasl.git/commit/?id=d4e608649a7a5190a735e314c1154f24dbbb8ac5

The branch, master has been updated
       via  d4e608649a7a5190a735e314c1154f24dbbb8ac5 (commit)
      from  e77e3e666817ffb9ca8fe87c47a99873c386c9ed (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d4e608649a7a5190a735e314c1154f24dbbb8ac5
Author: Simon Josefsson <address@hidden>
Date:   Sun Apr 25 16:39:33 2010 +0200

    Update gnulib files.

-----------------------------------------------------------------------

Summary of changes:
 gl/vasnprintf.c                   |   13 ++++++++++---
 gltests/Makefile.am               |    2 +-
 gltests/test-vc-list-files-cvs.sh |   18 +++++-------------
 gltests/test-vc-list-files-git.sh |   16 ++++------------
 lib/build-aux/vc-list-files       |    4 +++-
 lib/gl/m4/strnlen.m4              |   18 +++++++++---------
 lib/gl/vasnprintf.c               |   13 ++++++++++---
 lib/gltests/test-vasprintf.c      |   20 ++++++++++++++++++++
 lib/maint.mk                      |    6 ++++++
 maint.mk                          |    6 ++++++
 10 files changed, 74 insertions(+), 42 deletions(-)

diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 1ca8d53..723e05d 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -4953,6 +4953,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       }
 #endif
 
+                    errno = 0;
                     switch (type)
                       {
                       case TYPE_SCHAR:
@@ -5147,15 +5148,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     /* Attempt to handle failure.  */
                     if (count < 0)
                       {
+                        /* SNPRINTF or sprintf failed.  Save and use the errno
+                           that it has set, if any.  */
+                        int saved_errno = errno;
+
                         if (!(result == resultbuf || result == NULL))
                           free (result);
                         if (buf_malloced != NULL)
                           free (buf_malloced);
                         CLEANUP ();
                         errno =
-                          (dp->conversion == 'c' || dp->conversion == 's'
-                           ? EILSEQ
-                           : EINVAL);
+                          (saved_errno != 0
+                           ? saved_errno
+                           : (dp->conversion == 'c' || dp->conversion == 's'
+                              ? EILSEQ
+                              : EINVAL));
                         return NULL;
                       }
 
diff --git a/gltests/Makefile.am b/gltests/Makefile.am
index c4cf765..6e70be3 100644
--- a/gltests/Makefile.am
+++ b/gltests/Makefile.am
@@ -929,7 +929,7 @@ EXTRA_DIST += test-vasnprintf.c macros.h
 TESTS += test-vc-list-files-git.sh
 TESTS += test-vc-list-files-cvs.sh
 TESTS_ENVIRONMENT += PATH='$(abs_aux_dir)'$(PATH_SEPARATOR)"$$PATH"
-EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh
+EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh init.sh
 
 ## end   gnulib module vc-list-files-tests
 
diff --git a/gltests/test-vc-list-files-cvs.sh 
b/gltests/test-vc-list-files-cvs.sh
index 110be03..43a3b3f 100755
--- a/gltests/test-vc-list-files-cvs.sh
+++ b/gltests/test-vc-list-files-cvs.sh
@@ -16,18 +16,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-tmpdir=vc-cvs-$$
-trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
-  compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
-  compare() { cmp -s "$@"; }
-else
-  compare() { cmp "$@"; }
-fi
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
 
+tmpdir=vc-cvs
 repo=`pwd`/$tmpdir/repo
 
 fail=0
@@ -46,7 +38,7 @@ for i in with-cvsu without; do
     # without cvs, skip the test
     # The double use of 'exit' is needed for the reference to $? inside the 
trap.
     { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \
-      || { echo "Skipping test: cvs not found in PATH"; (exit 77); exit 77; }; 
} &&
+      || skip_ "cvs not found in PATH"; } &&
     mkdir w && cd w &&
     mkdir d &&
     touch d/a b c &&
@@ -59,4 +51,4 @@ for i in with-cvsu without; do
   test $ok = 0 && fail=1
 done
 
-(exit $fail); exit $fail
+Exit $fail
diff --git a/gltests/test-vc-list-files-git.sh 
b/gltests/test-vc-list-files-git.sh
index 56a9a5b..4757625 100755
--- a/gltests/test-vc-list-files-git.sh
+++ b/gltests/test-vc-list-files-git.sh
@@ -16,18 +16,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
-  compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
-  compare() { cmp -s "$@"; }
-else
-  compare() { cmp "$@"; }
-fi
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
 
 tmpdir=vc-git-$$
-trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
 GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE
 
 fail=1
@@ -35,7 +27,7 @@ mkdir $tmpdir && cd $tmpdir &&
   # without git, skip the test
   # The double use of 'exit' is needed for the reference to $? inside the trap.
   { ( git init -q ) > /dev/null 2>&1 \
-    || { echo "Skipping test: git not found in PATH"; (exit 77); exit 77; }; } 
&&
+    || skip_ "git not found in PATH"; } &&
   mkdir d &&
   touch d/a b c &&
   git config user.email "address@hidden" &&
@@ -47,4 +39,4 @@ mkdir $tmpdir && cd $tmpdir &&
   compare expected actual &&
   fail=0
 
-(exit $fail); exit $fail
+Exit $fail
diff --git a/lib/build-aux/vc-list-files b/lib/build-aux/vc-list-files
index b9f2fbd..48a33ee 100755
--- a/lib/build-aux/vc-list-files
+++ b/lib/build-aux/vc-list-files
@@ -2,7 +2,7 @@
 # List version-controlled file names.
 
 # Print a version string.
-scriptversion=2010-02-21.13; # UTC
+scriptversion=2010-04-23.22; # UTC
 
 # Copyright (C) 2006-2010 Free Software Foundation, Inc.
 
@@ -102,6 +102,8 @@ elif test -d CVS; then
        }}'\''                          \
       `find "$dir" -name Entries -print` /dev/null' $postprocess
   fi
+elif test -d .svn; then
+  eval exec svn list -R '"$dir"' $postprocess
 else
   echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
   exit 1
diff --git a/lib/gl/m4/strnlen.m4 b/lib/gl/m4/strnlen.m4
index fabce50..52bb838 100644
--- a/lib/gl/m4/strnlen.m4
+++ b/lib/gl/m4/strnlen.m4
@@ -1,4 +1,4 @@
-# strnlen.m4 serial 11
+# strnlen.m4 serial 12
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -15,15 +15,15 @@ AC_DEFUN([gl_FUNC_STRNLEN],
   AC_CHECK_DECLS_ONCE([strnlen])
   if test $ac_cv_have_decl_strnlen = no; then
     HAVE_DECL_STRNLEN=0
+  else
+    AC_FUNC_STRNLEN
+    dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]).
+    if test $ac_cv_func_strnlen_working = no; then
+      REPLACE_STRNLEN=1
+    fi
   fi
-
-  AC_FUNC_STRNLEN
-  if test $ac_cv_func_strnlen_working = no; then
-    REPLACE_STRNLEN=1
-    # This is necessary because automake-1.6.1 doesn't understand
-    # that the above use of AC_FUNC_STRNLEN means we may have to use
-    # lib/strnlen.c.
-    #AC_LIBOBJ([strnlen])
+  if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+    AC_LIBOBJ([strnlen])
     gl_PREREQ_STRNLEN
   fi
 ])
diff --git a/lib/gl/vasnprintf.c b/lib/gl/vasnprintf.c
index 056e0cd..41967fd 100644
--- a/lib/gl/vasnprintf.c
+++ b/lib/gl/vasnprintf.c
@@ -4953,6 +4953,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       }
 #endif
 
+                    errno = 0;
                     switch (type)
                       {
                       case TYPE_SCHAR:
@@ -5147,15 +5148,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     /* Attempt to handle failure.  */
                     if (count < 0)
                       {
+                        /* SNPRINTF or sprintf failed.  Save and use the errno
+                           that it has set, if any.  */
+                        int saved_errno = errno;
+
                         if (!(result == resultbuf || result == NULL))
                           free (result);
                         if (buf_malloced != NULL)
                           free (buf_malloced);
                         CLEANUP ();
                         errno =
-                          (dp->conversion == 'c' || dp->conversion == 's'
-                           ? EILSEQ
-                           : EINVAL);
+                          (saved_errno != 0
+                           ? saved_errno
+                           : (dp->conversion == 'c' || dp->conversion == 's'
+                              ? EILSEQ
+                              : EINVAL));
                         return NULL;
                       }
 
diff --git a/lib/gltests/test-vasprintf.c b/lib/gltests/test-vasprintf.c
index e5dc3cd..cfde4f4 100644
--- a/lib/gltests/test-vasprintf.c
+++ b/lib/gltests/test-vasprintf.c
@@ -56,6 +56,16 @@ test_vasprintf ()
       ASSERT (strcmp (result, "12345") == 0);
       free (result);
     }
+
+  for (repeat = 0; repeat <= 8; repeat++)
+    {
+      char *result;
+      int retval = my_asprintf (&result, "%08lx", 12345UL);
+      ASSERT (retval == 8);
+      ASSERT (result != NULL);
+      ASSERT (strcmp (result, "00003039") == 0);
+      free (result);
+    }
 }
 
 static void
@@ -72,6 +82,16 @@ test_asprintf ()
       ASSERT (strcmp (result, "12345") == 0);
       free (result);
     }
+
+  for (repeat = 0; repeat <= 8; repeat++)
+    {
+      char *result;
+      int retval = asprintf (&result, "%08lx", 12345UL);
+      ASSERT (retval == 8);
+      ASSERT (result != NULL);
+      ASSERT (strcmp (result, "00003039") == 0);
+      free (result);
+    }
 }
 
 int
diff --git a/lib/maint.mk b/lib/maint.mk
index f646e43..33803f3 100644
--- a/lib/maint.mk
+++ b/lib/maint.mk
@@ -645,6 +645,12 @@ sc_useless_cpp_parens:
        halt='found useless parentheses in cpp directive'               \
          $(_sc_search_regexp)
 
+# Prohibit checked in backup files.
+sc_prohibit_backup_files:
+       @$(VC_LIST) | grep '~$$' &&                             \
+         { echo '$(ME): found version controlled backup file' 1>&2;    \
+           exit 1; } || :
+
 # Require the latest GPL.
 sc_GPL_version:
        @prohibit='either ''version [^3]'                               \
diff --git a/maint.mk b/maint.mk
index f646e43..33803f3 100644
--- a/maint.mk
+++ b/maint.mk
@@ -645,6 +645,12 @@ sc_useless_cpp_parens:
        halt='found useless parentheses in cpp directive'               \
          $(_sc_search_regexp)
 
+# Prohibit checked in backup files.
+sc_prohibit_backup_files:
+       @$(VC_LIST) | grep '~$$' &&                             \
+         { echo '$(ME): found version controlled backup file' 1>&2;    \
+           exit 1; } || :
+
 # Require the latest GPL.
 sc_GPL_version:
        @prohibit='either ''version [^3]'                               \


hooks/post-receive
-- 
GNU gsasl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]