libtasn1-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libtasn1 branch, master, updated. libtasn1_3_2-17-g158d724


From: Simon Josefsson
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_2-17-g158d724
Date: Sun, 24 Mar 2013 10:50:55 +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 libtasn1".

http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=158d724f503274b19152dc73ff518c14525f3600

The branch, master has been updated
       via  158d724f503274b19152dc73ff518c14525f3600 (commit)
       via  dc1b1515bf4f58b526326e004982965d9bee2e9e (commit)
       via  661f3b91335ed8c57abfe2713464694cb4da3d05 (commit)
       via  c81c317e46b8390cf454129b5bcf2923fcf783ae (commit)
       via  d8c002366d1371c8d975ef4a9a32c68d3a5416cd (commit)
       via  602c40bc5433bbb66fe6f92b14c523d2bbb867ab (commit)
       via  b41f257a2515cd759b8779332d83f72ba9605de1 (commit)
       via  36f03daf3361187cc556a35dd36761302ccd94d5 (commit)
       via  f36dd027a9002fcd2eec72aa3f445e03b8c7984d (commit)
       via  50e02f7e015ccd603d89039f1ad82a5b2eb9a25a (commit)
      from  eb7dcd9f2da288acf527e13fc8f701d7b20886bf (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 158d724f503274b19152dc73ff518c14525f3600
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 11:00:19 2013 +0100

    Fix syntax-check warnings.

commit dc1b1515bf4f58b526326e004982965d9bee2e9e
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:59:52 2013 +0100

    Bump versions.

commit 661f3b91335ed8c57abfe2713464694cb4da3d05
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:54:53 2013 +0100

    Fix syntax-check warnings.

commit c81c317e46b8390cf454129b5bcf2923fcf783ae
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:41:52 2013 +0100

    Generated.

commit d8c002366d1371c8d975ef4a9a32c68d3a5416cd
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:41:44 2013 +0100

    Bump version.

commit 602c40bc5433bbb66fe6f92b14c523d2bbb867ab
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:33:24 2013 +0100

    Update copyright years.

commit b41f257a2515cd759b8779332d83f72ba9605de1
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:31:25 2013 +0100

    Version 3.3.

commit 36f03daf3361187cc556a35dd36761302ccd94d5
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:28:25 2013 +0100

    Indent code.

commit f36dd027a9002fcd2eec72aa3f445e03b8c7984d
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:27:46 2013 +0100

    Silence warnings.

commit 50e02f7e015ccd603d89039f1ad82a5b2eb9a25a
Author: Simon Josefsson <address@hidden>
Date:   Sun Mar 24 10:17:07 2013 +0100

    Update gnulib files.

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

Summary of changes:
 .clcopying                       |    2 +-
 .gitignore                       |   10 +-
 AUTHORS                          |    2 +-
 GNUmakefile                      |    2 +-
 Makefile.am                      |    2 +-
 NEWS                             |    4 +-
 README                           |    2 +-
 README-alpha                     |    2 +-
 THANKS                           |    2 +-
 build-aux/gendocs.sh             |  278 +++++++++++++++++++++++++-------------
 build-aux/gnupload               |   40 ++++--
 build-aux/pmccabe2html           |    2 +-
 build-aux/update-copyright       |    6 +-
 build-aux/useless-if-before-free |    2 +-
 build-aux/vc-list-files          |    2 +-
 cfg.mk                           |    4 +-
 configure.ac                     |    5 +-
 doc/Makefile.am                  |    4 +-
 doc/TODO                         |    2 +-
 doc/cyclo/Makefile.am            |    2 +-
 doc/fdl-1.3.texi                 |    2 +-
 doc/gendocs_template             |    4 +-
 doc/libtasn1.texi                |    2 +-
 examples/CertificateExample.c    |    2 +-
 examples/CrlExample.c            |    2 +-
 examples/Makefile.am             |    2 +-
 examples/asn1Coding_test.asn     |    2 +-
 examples/pkix.asn                |    2 +-
 gl/Makefile.am                   |    6 +-
 gl/errno.in.h                    |    7 +-
 gl/fstat.c                       |    6 +-
 gl/ftell.c                       |    2 +-
 gl/ftello.c                      |    2 +-
 gl/getopt.c                      |    2 +-
 gl/getopt.in.h                   |    4 +-
 gl/getopt1.c                     |    2 +-
 gl/getopt_int.h                  |    2 +-
 gl/gettext.h                     |    2 +-
 gl/gettime.c                     |    2 +-
 gl/gettimeofday.c                |    2 +-
 gl/lseek.c                       |    2 +-
 gl/m4/00gnulib.m4                |    2 +-
 gl/m4/autobuild.m4               |    2 +-
 gl/m4/clock_time.m4              |    2 +-
 gl/m4/errno_h.m4                 |    7 +-
 gl/m4/extensions.m4              |   49 +++++---
 gl/m4/extern-inline.m4           |   26 +++-
 gl/m4/fseeko.m4                  |    2 +-
 gl/m4/fstat.m4                   |    9 +-
 gl/m4/ftell.m4                   |    2 +-
 gl/m4/ftello.m4                  |    2 +-
 gl/m4/getopt.m4                  |    2 +-
 gl/m4/gettime.m4                 |    2 +-
 gl/m4/gettimeofday.m4            |    2 +-
 gl/m4/gnulib-cache.m4            |    2 +-
 gl/m4/gnulib-common.m4           |    8 +-
 gl/m4/gnulib-comp.m4             |    3 +-
 gl/m4/gnulib-tool.m4             |    2 +-
 gl/m4/include_next.m4            |    2 +-
 gl/m4/largefile.m4               |   25 ++--
 gl/m4/longlong.m4                |    2 +-
 gl/m4/lseek.m4                   |    2 +-
 gl/m4/malloc.m4                  |    2 +-
 gl/m4/manywarnings.m4            |   34 ++++-
 gl/m4/msvc-inval.m4              |    2 +-
 gl/m4/msvc-nothrow.m4            |    2 +-
 gl/m4/multiarch.m4               |    2 +-
 gl/m4/nocrash.m4                 |    2 +-
 gl/m4/off_t.m4                   |    2 +-
 gl/m4/read-file.m4               |    2 +-
 gl/m4/realloc.m4                 |    2 +-
 gl/m4/ssize_t.m4                 |    2 +-
 gl/m4/stdarg.m4                  |    2 +-
 gl/m4/stddef_h.m4                |    2 +-
 gl/m4/stdint.m4                  |    2 +-
 gl/m4/stdio_h.m4                 |    5 +-
 gl/m4/stdlib_h.m4                |    9 +-
 gl/m4/sys_socket_h.m4            |    5 +-
 gl/m4/sys_stat_h.m4              |    7 +-
 gl/m4/sys_time_h.m4              |    2 +-
 gl/m4/sys_types_h.m4             |    6 +-
 gl/m4/time_h.m4                  |    2 +-
 gl/m4/timespec.m4                |    2 +-
 gl/m4/unistd_h.m4                |    5 +-
 gl/m4/valgrind-tests.m4          |    2 +-
 gl/m4/version-etc.m4             |    2 +-
 gl/m4/warn-on-use.m4             |    2 +-
 gl/m4/warnings.m4                |    2 +-
 gl/m4/wchar_t.m4                 |    2 +-
 gl/malloc.c                      |    2 +-
 gl/msvc-inval.c                  |    2 +-
 gl/msvc-inval.h                  |    2 +-
 gl/msvc-nothrow.c                |    2 +-
 gl/msvc-nothrow.h                |    2 +-
 gl/progname.c                    |    2 +-
 gl/progname.h                    |    2 +-
 gl/read-file.c                   |    6 +-
 gl/read-file.h                   |    2 +-
 gl/realloc.c                     |    2 +-
 gl/stdarg.in.h                   |    2 +-
 gl/stddef.in.h                   |    2 +-
 gl/stdint.in.h                   |    2 +-
 gl/stdio-impl.h                  |    2 +-
 gl/stdio.in.h                    |   23 ++--
 gl/stdlib.in.h                   |   36 +++++-
 gl/sys_stat.in.h                 |    8 +-
 gl/sys_time.in.h                 |  197 ++++++++++++++-------------
 gl/sys_types.in.h                |    2 +-
 gl/time.in.h                     |    2 +-
 gl/timespec.h                    |    2 +-
 gl/unistd.c                      |    3 +
 gl/unistd.in.h                   |   39 +++---
 gl/version-etc-fsf.c             |    2 +-
 gl/version-etc.c                 |    4 +-
 gl/version-etc.h                 |    2 +-
 lib/ASN1.c                       |    5 +-
 lib/ASN1.y                       |    5 +-
 lib/Makefile.am                  |    2 +-
 lib/coding.c                     |  122 ++++++++++-------
 lib/decoding.c                   |  157 +++++++++++-----------
 lib/element.c                    |   94 +++++++-------
 lib/element.h                    |    6 +-
 lib/errors.c                     |    2 +-
 lib/gllib/stdint.in.h            |    2 +-
 lib/glm4/extensions.m4           |   47 +++++---
 lib/gstr.c                       |    5 +-
 lib/gstr.h                       |    5 +-
 lib/int.h                        |   23 ++--
 lib/libtasn1.h                   |   49 ++++---
 lib/libtasn1.map                 |    3 +-
 lib/libtasn1.pc.in               |    2 +-
 lib/parser_aux.c                 |   43 +++---
 lib/parser_aux.h                 |    2 +-
 lib/structure.c                  |   39 +++---
 lib/structure.h                  |    5 +-
 lib/version.c                    |    2 +-
 m4/update-header-version.m4      |    2 +-
 maint.mk                         |  155 ++++++++++++++-------
 src/Makefile.am                  |    2 +-
 src/asn1Coding.c                 |   18 +--
 src/asn1Decoding.c               |   71 +++++-----
 src/asn1Parser.c                 |   11 +-
 src/benchmark.c                  |   35 +++---
 src/benchmark.h                  |   18 ++--
 tests/Makefile.am                |    2 +-
 tests/Test_encoding.asn          |    2 +-
 tests/Test_encoding.c            |    7 +-
 tests/Test_errors.c              |    8 +-
 tests/Test_indefinite.c          |    2 +-
 tests/Test_overflow.c            |  139 ++++++++++---------
 tests/Test_parser.asn            |    2 +-
 tests/Test_parser.c              |   24 +++-
 tests/Test_simple.c              |    2 +-
 tests/Test_strings.c             |   84 +++++++-----
 tests/Test_tree.asn              |    2 +-
 tests/Test_tree.c                |   91 ++++++++-----
 tests/benchmark                  |    2 +-
 tests/crlf                       |    2 +-
 tests/pkix.asn                   |    2 +-
 tests/threadsafety               |    2 +-
 windows/libtasn14win.mk          |    2 +-
 161 files changed, 1341 insertions(+), 1018 deletions(-)
 create mode 100644 gl/unistd.c

diff --git a/.clcopying b/.clcopying
index 4c160b6..c811644 100644
--- a/.clcopying
+++ b/.clcopying
@@ -1,5 +1,5 @@
        ----------------------------------------------------------------------
-       Copyright (C) 2002-2012 Free Software Foundation, Inc.
+       Copyright (C) 2002-2013 Free Software Foundation, Inc.
        Copying and distribution of this file, with or without modification,
        are permitted in any medium without royalty provided the copyright
        notice and this notice are preserved.
diff --git a/.gitignore b/.gitignore
index 2b5f79c..649598b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,7 @@
-tags
-*~
 *.gcda
 *.gcno
 *.gcov
+*~
 ChangeLog
 INSTALL
 Makefile
@@ -119,6 +118,8 @@ gl/time.h
 gl/timespec.lo
 gl/timespec.o
 gl/unistd.h
+gl/unistd.lo
+gl/unistd.o
 gl/version-etc-fsf.lo
 gl/version-etc-fsf.o
 gl/version-etc.lo
@@ -185,13 +186,12 @@ src/asn1Parser
 src/asn1Parser.o
 src/benchmark.o
 stamp-h1
+tags
 tests/.deps/
 tests/Makefile
 tests/Makefile.in
 tests/Test_encoding
 tests/Test_encoding.o
-tests/Test_strings.o
-tests/Test_strings
 tests/Test_errors
 tests/Test_errors.o
 tests/Test_indefinite
@@ -203,6 +203,8 @@ tests/Test_parser.o
 tests/Test_parser_ERROR.asn
 tests/Test_simple
 tests/Test_simple.o
+tests/Test_strings
+tests/Test_strings.o
 tests/Test_tree
 tests/Test_tree.o
 windows/libtasn1-*-win??.zip
diff --git a/AUTHORS b/AUTHORS
index 7321657..f0bb059 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,7 +6,7 @@ Current maintainer:
 Simon Josefsson <address@hidden>
 
 ----------------------------------------------------------------------
-Copyright (C) 2002-2012 Free Software Foundation, Inc.
+Copyright (C) 2002-2013 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
diff --git a/GNUmakefile b/GNUmakefile
index 58f2ead..8759034 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -5,7 +5,7 @@
 # It is necessary if you want to build targets usually of interest
 # only to the maintainer.
 
-# Copyright (C) 2001, 2003, 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2013 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
diff --git a/Makefile.am b/Makefile.am
index 854dbdb..e4cab15 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/NEWS b/NEWS
index 4641ab9..11b014b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 GNU Libtasn1 NEWS                                     -*- outline -*-
 
-* Noteworthy changes in release 3.3 (unreleased) [stable]
+* Noteworthy changes in release 3.3 (released 2013-03-23) [stable]
 - More precise overflow checks using gnulib's intprops module.
 - Updates to compile in Android systems.
 
@@ -393,7 +393,7 @@ by Andreas Metzler).
 - Initial release
 
 ----------------------------------------------------------------------
-Copyright (C) 2002-2012 Free Software Foundation, Inc.
+Copyright (C) 2002-2013 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
diff --git a/README b/README
index d637179..24b1d4c 100644
--- a/README
+++ b/README
@@ -16,7 +16,7 @@ For any copyright year range specified as YYYY-ZZZZ in this 
package
 note that the range specifies every single year in that closed interval.
 
 ----------------------------------------------------------------------
-Copyright (C) 2002-2012 Free Software Foundation, Inc.
+Copyright (C) 2002-2013 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
diff --git a/README-alpha b/README-alpha
index 8ff2c85..b88c5aa 100644
--- a/README-alpha
+++ b/README-alpha
@@ -43,7 +43,7 @@ $ make check
 Happy hacking!
 
 ----------------------------------------------------------------------
-Copyright (C) 2009-2012 Free Software Foundation, Inc.
+Copyright (C) 2009-2013 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
diff --git a/THANKS b/THANKS
index 2b78d11..bd8064c 100644
--- a/THANKS
+++ b/THANKS
@@ -21,7 +21,7 @@ Jeffrey Walton          <address@hidden>
 Matthew Hall            <address@hidden>
 
 ----------------------------------------------------------------------
-Copyright (C) 2002-2012 Free Software Foundation, Inc.
+Copyright (C) 2002-2013 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index c293f96..98c7523 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,9 +2,9 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2012-09-02.17
+scriptversion=2013-03-08.15
 
-# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
 # Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -30,6 +30,12 @@ scriptversion=2012-09-02.17
 #
 # An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib).
 
+# TODO:
+# - image importation was only implemented for HTML generated by
+#   makeinfo.  But it should be simple enough to adjust.
+# - images are not imported in the source tarball.  All the needed
+#   formats (PDF, PNG, etc.) should be included.
+
 prog=`basename "$0"`
 srcdir=`pwd`
 
@@ -39,19 +45,18 @@ 
templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/
 : ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
 : ${MAKEINFO="makeinfo"}
 : ${TEXI2DVI="texi2dvi -t @finalout"}
-: ${DVIPS="dvips"}
 : ${DOCBOOK2HTML="docbook2html"}
 : ${DOCBOOK2PDF="docbook2pdf"}
-: ${DOCBOOK2PS="docbook2ps"}
 : ${DOCBOOK2TXT="docbook2txt"}
 : ${GENDOCS_TEMPLATE_DIR="."}
+: ${PERL='perl'}
 : ${TEXI2HTML="texi2html"}
 unset CDPATH
 unset use_texi2html
 
 version="gendocs.sh $scriptversion
 
-Copyright 2012 Free Software Foundation, Inc.
+Copyright 2013 Free Software Foundation, Inc.
 There is NO warranty.  You may redistribute this software
 under the terms of the GNU General Public License.
 For more information about these matters, see the files named COPYING."
@@ -64,15 +69,23 @@ discussion:
   http://www.gnu.org/prep/maintain_toc.html
 
 Options:
-  -s SRCFILE  read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi}
-  -o OUTDIR   write files into OUTDIR, instead of manual/.
-  --email ADR use ADR as contact in generated web pages.
-  --docbook   convert to DocBook too (xml, txt, html, pdf and ps).
-  --html ARG  pass indicated ARG to makeinfo or texi2html for HTML targets.
-  --info ARG  pass indicated ARG to makeinfo for Info, instead of --no-split.
-  --texi2html use texi2html to generate HTML targets.
-  --help      display this help and exit successfully.
-  --version   display version information and exit successfully.
+  --email ADR use ADR as contact in generated web pages; always give this.
+
+  -s SRCFILE   read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi}
+  -o OUTDIR    write files into OUTDIR, instead of manual/.
+  -I DIR       append DIR to the Texinfo search path.
+  --common ARG pass ARG in all invocations.
+  --html ARG   pass ARG to makeinfo or texi2html for HTML targets.
+  --info ARG   pass ARG to makeinfo for Info, instead of --no-split.
+  --no-ascii   skip generating the plain text output.
+  --source ARG include ARG in tar archive of sources.
+  --split HOW  make split HTML by node, section, chapter; default node.
+
+  --texi2html  use texi2html to make HTML target, with all split versions.
+  --docbook    convert through DocBook too (xml, txt, html, pdf).
+
+  --help       display this help and exit successfully.
+  --version    display version information and exit successfully.
 
 Simple example: $prog --email address@hidden emacs \"GNU Emacs Manual\"
 
@@ -86,8 +99,8 @@ Output will be in a new subdirectory \"manual\" (by default;
 use -o OUTDIR to override).  Move all the new files into your web CVS
 tree, as explained in the Web Pages node of maintain.texi.
 
-Please do use the --email ADDRESS option to specify your bug-reporting
-address in the generated HTML pages.
+Please use the --email ADDRESS option so your own bug-reporting
+address will be used in the generated HTML pages.
 
 MANUAL-TITLE is included as part of the HTML <title> of the overall
 manual/index.html file.  It should include the name of the package being
@@ -107,11 +120,11 @@ first copy or symlink all Texinfo sources into a single 
directory.
 As implied above, by default monolithic Info files are generated.
 If you want split Info, or other Info options, use --info to override.
 
-You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, and
-DVIPS to control the programs that get executed, and
+You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML,
+and PERL to control the programs that get executed, and
 GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is
 looked for.  With --docbook, the environment variables DOCBOOK2HTML,
-DOCBOOK2PDF, DOCBOOK2PS, and DOCBOOK2TXT are also respected.
+DOCBOOK2PDF, and DOCBOOK2TXT are also consulted.
 
 By default, makeinfo and texi2dvi are run in the default (English)
 locale, since that's the language of most Texinfo manuals.  If you
@@ -121,31 +134,37 @@ SETLANG setting in the source.
 Email bug reports or enhancement requests to address@hidden
 "
 
-calcsize()
-{
-  size=`ls -ksl $1 | awk '{print $1}'`
-  echo $size
-}
-
 MANUAL_TITLE=
 PACKAGE=
 address@hidden  # please override with --email
+commonarg= # passed to all makeinfo/texi2html invcations.
+dirargs=   # passed to all tools (-I dir).
+dirs=      # -I's directories.
 htmlarg=
 infoarg=--no-split
+generate_ascii=true
 outdir=manual
+source_extra=
+split=node
 srcfile=
 
 while test $# -gt 0; do
   case $1 in
-    --email) shift; EMAIL=$1;;
-    --help) echo "$usage"; exit 0;;
-    --version) echo "$version"; exit 0;;
-    -s) shift; srcfile=$1;;
-    -o) shift; outdir=$1;;
-    --docbook) docbook=yes;;
-    --html) shift; htmlarg=$1;;
-    --info) shift; infoarg=$1;;
+    -s)          shift; srcfile=$1;;
+    -o)          shift; outdir=$1;;
+    -I)          shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";;
+    --common)    shift; commonarg=$1;;
+    --docbook)   docbook=yes;;
+    --email)     shift; EMAIL=$1;;
+    --html)      shift; htmlarg=$1;;
+    --info)      shift; infoarg=$1;;
+    --no-ascii)  generate_ascii=false;;
+    --source)    shift; source_extra=$1;;
+    --split)     shift; split=$1;;
     --texi2html) use_texi2html=1;;
+
+    --help)      echo "$usage"; exit 0;;
+    --version)   echo "$version"; exit 0;;
     -*)
       echo "$0: Unknown option \`$1'." >&2
       echo "$0: Try \`--help' for more information." >&2
@@ -163,6 +182,9 @@ while test $# -gt 0; do
   shift
 done
 
+# makeinfo uses the dirargs, but texi2dvi doesn't.
+commonarg=" $dirargs $commonarg"
+
 # For most of the following, the base name is just $PACKAGE
 base=$PACKAGE
 
@@ -190,57 +212,107 @@ if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
   exit 1
 fi
 
+# Function to return size of $1 in something resembling kilobytes.
+calcsize()
+{
+  size=`ls -ksl $1 | awk '{print $1}'`
+  echo $size
+}
+
+# copy_images OUTDIR HTML-FILE...
+# -------------------------------
+# Copy all the images needed by the HTML-FILEs into OUTDIR.  Look
+# for them in the -I directories.
+copy_images()
+{
+  local odir
+  odir=$1
+  shift
+  $PERL -n -e "
+BEGIN {
+  \$me = '$prog';
+  \$odir = '$odir';
+  @dirs = qw($dirs);
+}
+" -e '
+/<img src="(.*?)"/g && ++$need{$1};
+
+END {
+  #print "$me: @{[keys %need]}\n";  # for debugging, show images found.
+  FILE: for my $f (keys %need) {
+    for my $d (@dirs) {
+      if (-f "$d/$f") {
+        use File::Basename;
+        my $dest = dirname ("$odir/$f");
+        #
+        use File::Path;
+        -d $dest || mkpath ($dest)
+          || die "$me: cannot mkdir $dest: $!\n";
+        #
+        use File::Copy;
+        copy ("$d/$f", $dest)
+          || die "$me: cannot copy $d/$f to $dest: $!\n";
+        next FILE;
+      }
+    }
+    die "$me: $ARGV: cannot find image $f\n";
+  }
+}
+' -- "$@" || exit 1
+}
+
 case $outdir in
   /*) abs_outdir=$outdir;;
   *)  abs_outdir=$srcdir/$outdir;;
 esac
 
-echo "Generating output formats for $srcfile"
+echo "Making output for $srcfile"
+echo " in `pwd`"
+mkdir -p "$outdir/"
 
-cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $infoarg \"$srcfile\""
-echo "Generating info file(s)... ($cmd)"
+cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
+echo "Generating info... ($cmd)"
 eval "$cmd"
-mkdir -p "$outdir/"
 tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
+ls -l "$outdir/$PACKAGE.info.tar.gz"
 info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
 # do not mv the info files, there's no point in having them available
 # separately on the web.
 
-cmd="$SETLANG ${TEXI2DVI} \"$srcfile\""
-echo "Generating dvi ... ($cmd)"
+cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\""
+printf "\nGenerating dvi... ($cmd)\n"
 eval "$cmd"
-
-# now, before we compress dvi:
-echo "Generating postscript..."
-${DVIPS} $PACKAGE -o
-gzip -f -9 $PACKAGE.ps
-ps_gz_size=`calcsize $PACKAGE.ps.gz`
-mv $PACKAGE.ps.gz "$outdir/"
-
 # compress/finish dvi:
 gzip -f -9 $PACKAGE.dvi
 dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
 mv $PACKAGE.dvi.gz "$outdir/"
+ls -l "$outdir/$PACKAGE.dvi.gz"
 
-cmd="$SETLANG ${TEXI2DVI} --pdf \"$srcfile\""
-echo "Generating pdf ... ($cmd)"
+cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\""
+printf "\nGenerating pdf... ($cmd)\n"
 eval "$cmd"
 pdf_size=`calcsize $PACKAGE.pdf`
 mv $PACKAGE.pdf "$outdir/"
+ls -l "$outdir/$PACKAGE.pdf"
 
-cmd="$SETLANG $MAKEINFO -o $PACKAGE.txt --no-split --no-headers \"$srcfile\""
-echo "Generating ASCII... ($cmd)"
-eval "$cmd"
-ascii_size=`calcsize $PACKAGE.txt`
-gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
-ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"`
-mv $PACKAGE.txt "$outdir/"
+if $generate_ascii; then
+  opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
+  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
+  printf "\nGenerating ascii... ($cmd)\n"
+  eval "$cmd"
+  ascii_size=`calcsize $PACKAGE.txt`
+  gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
+  ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"`
+  mv $PACKAGE.txt "$outdir/"
+  ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
+fi
 
+# Split HTML at level $1.  Used for texi2html.
 html_split()
 {
-  opt="--split=$1 $htmlarg --node-files"
+  opt="--split=$1 --node-files $commonarg $htmlarg"
   cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\""
-  echo "Generating html by $1... ($cmd)"
+  printf "\nGenerating html by $1... ($cmd)\n"
   eval "$cmd"
   split_html_dir=$PACKAGE.html
   (
@@ -256,32 +328,48 @@ html_split()
 }
 
 if test -z "$use_texi2html"; then
-  opt="--no-split --html -o $PACKAGE.html $htmlarg"
+  opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg"
   cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
-  echo "Generating monolithic html... ($cmd)"
+  printf "\nGenerating monolithic html... ($cmd)\n"
   rm -rf $PACKAGE.html  # in case a directory is left over
   eval "$cmd"
   html_mono_size=`calcsize $PACKAGE.html`
   gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
   html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
+  copy_images "$outdir/" $PACKAGE.html
   mv $PACKAGE.html "$outdir/"
-
-  cmd="$SETLANG $MAKEINFO --html -o $PACKAGE.html $htmlarg \"$srcfile\""
-  echo "Generating html by node... ($cmd)"
+  ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz"
+
+  # Before Texinfo 5.0, makeinfo did not accept a --split=HOW option,
+  # it just always split by node.  So if we're splitting by node anyway,
+  # leave it out.
+  if test "x$split" = xnode; then
+    split_arg=
+  else
+    split_arg=--split=$split
+  fi
+  #
+  opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg"
+  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
+  printf "\nGenerating html by $split... ($cmd)\n"
   eval "$cmd"
   split_html_dir=$PACKAGE.html
+  copy_images $split_html_dir/ $split_html_dir/*.html
   (
-   cd ${split_html_dir} || exit 1
-   tar -czf "$abs_outdir/${PACKAGE}.html_node.tar.gz" -- *.html
+    cd $split_html_dir || exit 1
+    tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- *
   )
-  html_node_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node.tar.gz"`
-  rm -f "$outdir"/html_node/*.html
-  mkdir -p "$outdir/html_node/"
-  mv ${split_html_dir}/*.html "$outdir/html_node/"
-  rmdir ${split_html_dir}
-else
-  cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $htmlarg \"$srcfile\""
-  echo "Generating monolithic html... ($cmd)"
+  eval \
+    html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"`
+  rm -rf "$outdir/html_$split/"
+  mv $split_html_dir "$outdir/html_$split/"
+  du -s "$outdir/html_$split/"
+  ls -l "$outdir/$PACKAGE.html_$split.tar.gz"
+
+else # use texi2html:
+  opt="--output $PACKAGE.html $commonarg $htmlarg"
+  cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\""
+  printf "\nGenerating monolithic html with texi2html... ($cmd)\n"
   rm -rf $PACKAGE.html  # in case a directory is left over
   eval "$cmd"
   html_mono_size=`calcsize $PACKAGE.html`
@@ -294,18 +382,20 @@ else
   html_split section
 fi
 
-echo Making .tar.gz for sources...
+printf "\nMaking .tar.gz for sources...\n"
 d=`dirname $srcfile`
 (
   cd "$d"
-  srcfiles=`ls *.texinfo *.texi *.txi *.eps 2>/dev/null` || true
-  tar cvzfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles
+  srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || 
true
+  tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles
+  ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
 )
 texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
 
 if test -n "$docbook"; then
-  cmd="$SETLANG $MAKEINFO -o - --docbook \"$srcfile\" > 
${srcdir}/$PACKAGE-db.xml"
-  echo "Generating docbook XML... ($cmd)"
+  opt="-o - --docbook $commonarg"
+  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
+  printf "\nGenerating docbook XML... ($cmd)\n"
   eval "$cmd"
   docbook_xml_size=`calcsize $PACKAGE-db.xml`
   gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz"
@@ -313,8 +403,9 @@ if test -n "$docbook"; then
   mv $PACKAGE-db.xml "$outdir/"
 
   split_html_db_dir=html_node_db
-  cmd="${DOCBOOK2HTML} -o $split_html_db_dir \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook HTML... ($cmd)"
+  opt="$commonarg -o $split_html_db_dir"
+  cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\""
+  printf "\nGenerating docbook HTML... ($cmd)\n"
   eval "$cmd"
   (
     cd ${split_html_db_dir} || exit 1
@@ -326,33 +417,28 @@ if test -n "$docbook"; then
   mv ${split_html_db_dir}/*.html "$outdir/html_node_db/"
   rmdir ${split_html_db_dir}
 
-  cmd="${DOCBOOK2TXT} \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook ASCII... ($cmd)"
+  cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\""
+  printf "\nGenerating docbook ASCII... ($cmd)\n"
   eval "$cmd"
   docbook_ascii_size=`calcsize $PACKAGE-db.txt`
   mv $PACKAGE-db.txt "$outdir/"
 
-  cmd="${DOCBOOK2PS} \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook PS... ($cmd)"
-  eval "$cmd"
-  gzip -f -9 -c $PACKAGE-db.ps >"$outdir/$PACKAGE-db.ps.gz"
-  docbook_ps_gz_size=`calcsize "$outdir/$PACKAGE-db.ps.gz"`
-  mv $PACKAGE-db.ps "$outdir/"
-
-  cmd="${DOCBOOK2PDF} \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook PDF... ($cmd)"
+  cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\""
+  printf "\nGenerating docbook PDF... ($cmd)\n"
   eval "$cmd"
   docbook_pdf_size=`calcsize $PACKAGE-db.pdf`
   mv $PACKAGE-db.pdf "$outdir/"
 fi
 
-echo "Writing index file..."
+printf "\nMaking index file...\n"
 if test -z "$use_texi2html"; then
-   CONDS="/%%IF  *HTML_SECTION%%/,/%%ENDIF  *HTML_SECTION%%/d;\
-          /%%IF  *HTML_CHAPTER%%/,/%%ENDIF  *HTML_CHAPTER%%/d"
+  CONDS="/%%IF  *HTML_SECTION%%/,/%%ENDIF  *HTML_SECTION%%/d;\
+         /%%IF  *HTML_CHAPTER%%/,/%%ENDIF  *HTML_CHAPTER%%/d"
 else
-   CONDS="/%%ENDIF.*%%/d;/%%IF  *HTML_SECTION%%/d;/%%IF  *HTML_CHAPTER%%/d"
+  # should take account of --split here.
+  CONDS="/%%ENDIF.*%%/d;/%%IF  *HTML_SECTION%%/d;/%%IF  *HTML_CHAPTER%%/d"
 fi
+
 curdate=`$SETLANG date '+%B %d, %Y'`
 sed \
    -e "s!%%TITLE%%!$MANUAL_TITLE!g" \
@@ -367,13 +453,11 @@ sed \
    -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \
    -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \
    -e "s!%%PDF_SIZE%%!$pdf_size!g" \
-   -e "s!%%PS_GZ_SIZE%%!$ps_gz_size!g" \
    -e "s!%%ASCII_SIZE%%!$ascii_size!g" \
    -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \
    -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \
    -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \
    -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \
-   -e "s!%%DOCBOOK_PS_GZ_SIZE%%!$docbook_ps_gz_size!g" \
    -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \
    -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \
    -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \
diff --git a/build-aux/gnupload b/build-aux/gnupload
index a0e5c7b..7a137c1 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2012-06-11.00; # UTC
+scriptversion=2013-03-19.17; # UTC
 
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 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
@@ -39,9 +39,8 @@ nl='
 
 usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
 
-Sign all FILES, and process them at selected destinations according to CMD.
-<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
-explains further.
+Sign all FILES, and process them at the destinations specified with --to.
+If CMD is not given, it defaults to uploading.  See examples below.
 
 Commands:
   --delete                 delete FILES from destination
@@ -50,8 +49,7 @@ Commands:
   --                       treat the remaining arguments as files to upload
 
 Options:
-  --help                   print this help text and exit
-  --to DEST                specify one destination for FILES
+  --to DEST                specify a destination DEST for FILES
                            (multiple --to options are allowed)
   --user NAME              sign with key NAME
   --replace                allow replacements of existing files
@@ -59,10 +57,10 @@ Options:
   --dry-run                do nothing, show what would have been done
                            (including the constructed directive file)
   --version                output version information and exit
+  --help                   print this help text and exit
 
 If --symlink-regex is given without EXPR, then the link target name
 is created by replacing the version information with '-latest', e.g.:
-
   foo-1.3.4.tar.gz -> foo-latest.tar.gz
 
 Recognized destinations are:
@@ -80,6 +78,9 @@ in the current working directory, its contents are prepended 
to the
 actual command line options.  Use this to keep your defaults.  Comments
 (#) and empty lines in $conffile are allowed.
 
+<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
+gives some further background.
+
 Examples:
 1. Upload foobar-1.0.tar.gz to ftp.gnu.org:
   gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz
@@ -104,7 +105,7 @@ Examples:
            --delete oopsbar-0.9.91.tar.gz \\
            -- foobar-0.9.91.tar.gz
 
-gnupload uses the ncftpput program to do the transfers; if you don't
+gnupload executes a program ncftpput to do the transfers; if you don't
 happen to have an ncftp package installed, the ncftpput-ftp script in
 the build-aux/ directory of the gnulib package
 (http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
@@ -132,6 +133,12 @@ while test -n "$1"; do
       if test -z "$2"; then
         echo "$0: Missing argument for --to" 1>&2
         exit 1
+      elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then
+        echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2
+        echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2
+        echo "$0:  is used for direct ftp uploads, not with gnupload)." >&2
+        echo "$0: See --help and its examples if need be." >&2
+        exit 1
       else
         to="$to $2"
         shift
@@ -242,6 +249,8 @@ fi
 
 # Make sure passphrase is not exported in the environment.
 unset passphrase
+unset passphrase_fd_0
+GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg}
 
 # Reset PATH to be sure that echo is a built-in.  We will later use
 # 'echo $passphrase' to output the passphrase, so it is important that
@@ -249,12 +258,13 @@ unset passphrase
 # listings with their arguments...).
 # Remember this script runs with 'set -e', so if echo is not built-in
 # it will exit now.
-if $dry_run; then :; else
+if $dry_run || grep -q "^use-agent" $GNUPGHOME/gpg.conf; then :; else
   PATH=/empty echo -n "Enter GPG passphrase: "
   stty -echo
   read -r passphrase
   stty echo
   echo
+  passphrase_fd_0="--passphrase-fd 0"
 fi
 
 if test $# -ne 0; then
@@ -262,7 +272,7 @@ if test $# -ne 0; then
   do
     echo "Signing $file ..."
     rm -f $file.sig
-    echo "$passphrase" | $dbg $GPG --passphrase-fd 0 -ba -o $file.sig $file
+    echo "$passphrase" | $dbg $GPG $passphrase_fd_0 -ba -o $file.sig $file
   done
 fi
 
@@ -320,12 +330,12 @@ upload ()
   case $dest in
     alpha.gnu.org:*)
       mkdirective "$destdir" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign 
$base.directive
+      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign 
$base.directive
       $dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files 
$base.directive.asc
       ;;
     ftp.gnu.org:*)
       mkdirective "$destdir" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign 
$base.directive
+      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign 
$base.directive
       $dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc
       ;;
     savannah.gnu.org:*)
@@ -344,7 +354,7 @@ upload ()
       destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'`
       destdir_topdir=`echo "$destdir" | sed 's,/.*,,'`
       mkdirective "$destdir_p1" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign 
$base.directive
+      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign 
$base.directive
       for f in $files $base.directive.asc
       do
         echo put $f
@@ -353,7 +363,7 @@ upload ()
     /*)
       dest_host=`echo "$dest" | sed 's,:.*,,'`
       mkdirective "$destdir" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG --passphrase-fd 0 --clearsign 
$base.directive
+      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign 
$base.directive
       $dbg cp $files $base.directive.asc $dest_host
       ;;
     *)
diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html
index 7cf8df7..863c73e 100644
--- a/build-aux/pmccabe2html
+++ b/build-aux/pmccabe2html
@@ -1,6 +1,6 @@
 # pmccabe2html - AWK script to convert pmccabe output to html       -*- awk -*-
 
-# Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# Copyright (C) 2007-2013 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
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 082b749..c72d0e6 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -3,9 +3,9 @@ eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" 
${1+"$@"}'
     if 0;
 # Update an FSF copyright year list to include the current year.
 
-my $VERSION = '2012-02-05.21:39'; # UTC
+my $VERSION = '2013-01-03.09:41'; # UTC
 
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 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
@@ -192,7 +192,7 @@ if (defined $stmt_re)
     if ($final_year != $this_year)
       {
         # Update the year.
-        $stmt =~ s/$final_year_orig/$final_year, $this_year/;
+        $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
       }
     if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
       {
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 2b64630..663347a 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -10,7 +10,7 @@ my $VERSION = '2012-01-06 07:23'; # UTC
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-2013 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
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
index d477da8..7ec335f 100755
--- a/build-aux/vc-list-files
+++ b/build-aux/vc-list-files
@@ -4,7 +4,7 @@
 # Print a version string.
 scriptversion=2011-05-16.22; # UTC
 
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 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
diff --git a/cfg.mk b/cfg.mk
index aaa5f56..c7d4400 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2012  Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 # Author: Simon Josefsson
 #
 # This file is part of LIBTASN1.
@@ -39,6 +39,8 @@ exclude_file_name_regexp--sc_GPL_version = ^lib/libtasn1.h$$
 exclude_file_name_regexp--sc_program_name = ^tests/|examples/
 exclude_file_name_regexp--sc_prohibit_atoi_atof = 
^src/asn1Coding.c|src/asn1Decoding.c$$
 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = 
^tests/crlf.cer|tests/TestIndef.p12$$
+exclude_file_name_regexp--sc_error_message_uppercase = ^tests/Test_tree.c$$
+exclude_file_name_regexp--sc_unmarked_diagnostics = ^tests/Test_tree.c$$
 
 bootstrap-tools := autoconf,automake,libtool,bison
 gpg_key_ID = b565716f
diff --git a/configure.ac b/configure.ac
index a49dccd..f3cf552 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
@@ -17,7 +17,7 @@ dnl Process this file with autoconf to produce a configure 
script.
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.61])
-AC_INIT([GNU Libtasn1],[3.2],address@hidden)
+AC_INIT([GNU Libtasn1],[3.3],address@hidden)
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
@@ -89,6 +89,7 @@ if test "$gl_gcc_warnings" = yes; then
     gl_WARN_ADD([$w])
   done
 
+  gl_WARN_ADD([-Wno-type-limits])
   gl_WARN_ADD([-Wno-missing-field-initializers])
   gl_WARN_ADD([-Wno-unused-parameter])
   gl_WARN_ADD([-Wno-stack-protector])            # Some functions cannot be 
protected
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 2ede853..1af20bc 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
@@ -171,7 +171,7 @@ doit:
                        -sourceversion $(VERSION) \
                        -include libtasn1.h \
                        -seeinfo $(PACKAGE) -verbatimcopying \
-                       -copyright "2006-2012 Free Software Foundation, Inc." \
+                       -copyright "2006-2013 Free Software Foundation, Inc." \
                        -function $$i \
                        $(GDOC_SRC) > man/$$i.3 && \
                $(srcdir)/gdoc -texinfo -function $$i \
diff --git a/doc/TODO b/doc/TODO
index f420dc5..af1d897 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -13,7 +13,7 @@ Current list:
 (-) Means low priority (ie. nobody is interested to develop that)
 
 ----------------------------------------------------------------------
-Copyright (C) 2002-2012 Free Software Foundation, Inc.
+Copyright (C) 2002-2013 Free Software Foundation, Inc.
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.
diff --git a/doc/cyclo/Makefile.am b/doc/cyclo/Makefile.am
index df34d6a..1828fd7 100644
--- a/doc/cyclo/Makefile.am
+++ b/doc/cyclo/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/doc/fdl-1.3.texi b/doc/fdl-1.3.texi
index cb71f05..9c3bbe5 100644
--- a/doc/fdl-1.3.texi
+++ b/doc/fdl-1.3.texi
@@ -97,7 +97,7 @@ format, SGML or XML using a publicly available
 DTD, and standard-conforming simple HTML,
 PostScript or PDF designed for human modification.  Examples
 of transparent image formats include PNG, XCF and
-JPG.  Opaque formats include proprietary formats that can be
address@hidden  Opaque formats include proprietary formats that can be
 read and edited only by proprietary word processors, SGML or
 XML for which the DTD and/or processing tools are
 not generally available, and the machine-generated HTML,
diff --git a/doc/gendocs_template b/doc/gendocs_template
index cb51710..c04a67a 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -45,8 +45,6 @@
     (%%ASCII_GZ_SIZE%%K bytes gzipped)</a>.</li>
 <li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file
     (%%DVI_GZ_SIZE%%K bytes gzipped)</a>.</li>
-<li><a href="%%PACKAGE%%.ps.gz">PostScript file
-    (%%PS_GZ_SIZE%%K bytes gzipped)</a>.</li>
 <li><a href="%%PACKAGE%%.pdf">PDF file
     (%%PDF_SIZE%%K bytes)</a>.</li>
 <li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source
@@ -86,7 +84,7 @@ the FSF.<br />
 Please send broken links and other corrections or suggestions to
 <a href="mailto:%%EMAIL%%";>&lt;%%EMAIL%%&gt;</a>.</p>
 
-<p>Copyright &copy; 2012 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2013 Free Software Foundation, Inc.</p>
 
 <p>Verbatim copying and distribution of this entire article are
 permitted worldwide, without royalty, in any medium, provided this
diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi
index 5ef2cdb..f5c508f 100644
--- a/doc/libtasn1.texi
+++ b/doc/libtasn1.texi
@@ -15,7 +15,7 @@ This manual is for GNU Libtasn1
 which is a library for Abstract Syntax Notation One (ASN.1) and
 Distinguished Encoding Rules (DER) manipulation.
 
-Copyright @copyright{} 2001-2012 Free Software Foundation, Inc.
+Copyright @copyright{} 2001-2013 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/examples/CertificateExample.c b/examples/CertificateExample.c
index cd45f97..d05ec63 100644
--- a/examples/CertificateExample.c
+++ b/examples/CertificateExample.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/examples/CrlExample.c b/examples/CrlExample.c
index 94833de..75c14f1 100644
--- a/examples/CrlExample.c
+++ b/examples/CrlExample.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/examples/Makefile.am b/examples/Makefile.am
index e1772eb..7f0f3fb 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/examples/asn1Coding_test.asn b/examples/asn1Coding_test.asn
index ea21195..9ec235c 100644
--- a/examples/asn1Coding_test.asn
+++ b/examples/asn1Coding_test.asn
@@ -11,7 +11,7 @@ Sequence1 ::= SEQUENCE {
 
 END
 
--- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+-- Copyright (C) 2002-2013 Free Software Foundation, Inc.
 --
 -- This file is part of LIBTASN1.
 --
diff --git a/examples/pkix.asn b/examples/pkix.asn
index 5e4530d..1196759 100644
--- a/examples/pkix.asn
+++ b/examples/pkix.asn
@@ -1,4 +1,4 @@
--- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+-- Copyright (C) 2002-2013 Free Software Foundation, Inc.
 --
 -- This file is part of LIBTASN1.
 --
diff --git a/gl/Makefile.am b/gl/Makefile.am
index a0e4802..d97b595 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -613,6 +613,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
              -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
              -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+             -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
              -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
              -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
              -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
@@ -641,6 +642,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
              -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+             -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
              -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
              -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
@@ -654,6 +656,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
              -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
              -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
@@ -849,6 +852,7 @@ EXTRA_DIST += timespec.h
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
+libgnu_la_SOURCES += unistd.c
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
diff --git a/gl/errno.in.h b/gl/errno.in.h
index 5e5af92..49b3546 100644
--- a/gl/errno.in.h
+++ b/gl/errno.in.h
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2013 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
@@ -270,5 +270,10 @@
 #  define GNULIB_defined_ENOTRECOVERABLE 1
 # endif
 
+# ifndef EILSEQ
+#  define EILSEQ 2015
+#  define GNULIB_defined_EILSEQ 1
+# endif
+
 #endif /* address@hidden@_ERRNO_H */
 #endif /* address@hidden@_ERRNO_H */
diff --git a/gl/fstat.c b/gl/fstat.c
index 6d5f5c2..dc802f5 100644
--- a/gl/fstat.c
+++ b/gl/fstat.c
@@ -1,5 +1,5 @@
 /* fstat() replacement.
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 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
@@ -31,7 +31,7 @@
 #endif
 #undef __need_system_sys_stat_h
 
-static inline int
+static int
 orig_fstat (int fd, struct stat *buf)
 {
   return fstat (fd, buf);
@@ -51,7 +51,7 @@ orig_fstat (int fd, struct stat *buf)
 #endif
 
 #if HAVE_MSVC_INVALID_PARAMETER_HANDLER
-static inline int
+static int
 fstat_nothrow (int fd, struct stat *buf)
 {
   int result;
diff --git a/gl/ftell.c b/gl/ftell.c
index 817e9ff..4ad13c9 100644
--- a/gl/ftell.c
+++ b/gl/ftell.c
@@ -1,5 +1,5 @@
 /* An ftell() function that works around platform bugs.
-   Copyright (C) 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2007-2013 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
diff --git a/gl/ftello.c b/gl/ftello.c
index 1f581c5..3a2a0f2 100644
--- a/gl/ftello.c
+++ b/gl/ftello.c
@@ -1,5 +1,5 @@
 /* An ftello() function that works around platform bugs.
-   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2013 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
diff --git a/gl/getopt.c b/gl/getopt.c
index 4342a34..ef0f4ce 100644
--- a/gl/getopt.c
+++ b/gl/getopt.c
@@ -2,7 +2,7 @@
    NOTE: getopt is part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to address@hidden
    before changing it!
-   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2012 Free Software
+   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2013 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/gl/getopt.in.h b/gl/getopt.in.h
index 06b6dfc..d9c7d81 100644
--- a/gl/getopt.in.h
+++ b/gl/getopt.in.h
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2012 Free Software
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2013 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -49,7 +49,9 @@
    linkers.  */
 #if defined __GETOPT_PREFIX && !defined __need_getopt
 # if address@hidden@
+#  define __need_system_stdlib_h
 #  include <stdlib.h>
+#  undef __need_system_stdlib_h
 #  include <stdio.h>
 #  include <unistd.h>
 # endif
diff --git a/gl/getopt1.c b/gl/getopt1.c
index fb2a8f5..55a6b4e 100644
--- a/gl/getopt1.c
+++ b/gl/getopt1.c
@@ -1,5 +1,5 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2012 Free Software
+   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2013 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/gl/getopt_int.h b/gl/getopt_int.h
index 2da020c..a6e4b9e 100644
--- a/gl/getopt_int.h
+++ b/gl/getopt_int.h
@@ -1,5 +1,5 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2012 Free Software
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2013 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/gl/gettext.h b/gl/gettext.h
index 65ca1e6..d021571 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2013 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/gl/gettime.c b/gl/gettime.c
index 8075bfa..0a642dd 100644
--- a/gl/gettime.c
+++ b/gl/gettime.c
@@ -1,6 +1,6 @@
 /* gettime -- get the system clock
 
-   Copyright (C) 2002, 2004-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004-2007, 2009-2013 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
diff --git a/gl/gettimeofday.c b/gl/gettimeofday.c
index 5d35060..ad65c6d 100644
--- a/gl/gettimeofday.c
+++ b/gl/gettimeofday.c
@@ -1,6 +1,6 @@
 /* Provide gettimeofday for systems that don't have it or for which it's 
broken.
 
-   Copyright (C) 2001-2003, 2005-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009-2013 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
diff --git a/gl/lseek.c b/gl/lseek.c
index 794c230..fa7440d 100644
--- a/gl/lseek.c
+++ b/gl/lseek.c
@@ -1,5 +1,5 @@
 /* An lseek() function that detects pipes.
-   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2013 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
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
index d978cb8..d4ad759 100644
--- a/gl/m4/00gnulib.m4
+++ b/gl/m4/00gnulib.m4
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/autobuild.m4 b/gl/m4/autobuild.m4
index 284dc60..3147b5b 100644
--- a/gl/m4/autobuild.m4
+++ b/gl/m4/autobuild.m4
@@ -1,5 +1,5 @@
 # autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/clock_time.m4 b/gl/m4/clock_time.m4
index 0bec0ef..6597fb6 100644
--- a/gl/m4/clock_time.m4
+++ b/gl/m4/clock_time.m4
@@ -1,5 +1,5 @@
 # clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index 1e76ba2..c813ea5 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 11
-dnl Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc.
+# errno_h.m4 serial 12
+dnl Copyright (C) 2004, 2006, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -58,6 +58,9 @@ booboo
 #if !defined ENOTRECOVERABLE
 booboo
 #endif
+#if !defined EILSEQ
+booboo
+#endif
       ],
       [gl_cv_header_errno_h_complete=no],
       [gl_cv_header_errno_h_complete=yes])
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 6d17d8a..07ba376 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,14 +1,14 @@
-# serial 12  -*- Autoconf -*-
+# serial 13  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
 # Autoconf.  Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
@@ -30,6 +30,7 @@
 # ------------------------
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
+#
 # Remember that #undef in AH_VERBATIM gets replaced with #define by
 # AC_DEFINE.  The goal here is to define all known feature-enabling
 # macros, then, if reports of conflicts are made, disable macros that
@@ -38,8 +39,6 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 
-  AC_REQUIRE([AC_CANONICAL_HOST])
-
   AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
   if test "$MINIX" = yes; then
     AC_DEFINE([_POSIX_SOURCE], [1],
@@ -50,24 +49,18 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
        except with this defined.])
     AC_DEFINE([_MINIX], [1],
       [Define to 1 if on MINIX.])
+    AC_DEFINE([_NETBSD_SOURCE], [1],
+      [Define to 1 to make NetBSD features available.  MINIX 3 needs this.])
   fi
 
-  dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
-  dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
-  dnl provided.
-  case "$host_os" in
-    hpux*)
-      AC_DEFINE([_XOPEN_SOURCE], [500],
-        [Define to 500 only on HP-UX.])
-      ;;
-  esac
-
-  AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on Mac OS X.  */
+/* Enable general extensions on OS X.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
@@ -83,6 +76,12 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
+/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
+   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
 /* Enable general extensions on Solaris.  */
 #ifndef __EXTENSIONS__
 # undef __EXTENSIONS__
@@ -103,6 +102,22 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   AC_DEFINE([_GNU_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
+  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+    [ac_cv_should_define__xopen_source],
+    [ac_cv_should_define__xopen_source=no
+     AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[
+          #include <wchar.h>
+          mbstate_t x;]])],
+       [],
+       [AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+             #define _XOPEN_SOURCE 500
+             #include <wchar.h>
+             mbstate_t x;]])],
+          [ac_cv_should_define__xopen_source=yes])])])
+  test $ac_cv_should_define__xopen_source = yes &&
+    AC_DEFINE([_XOPEN_SOURCE], [500])
 ])# AC_USE_SYSTEM_EXTENSIONS
 
 # gl_USE_SYSTEM_EXTENSIONS
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
index 12f24fa..0152f29 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -1,13 +1,12 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012 Free Software Foundation, Inc.
+dnl Copyright 2012-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_EXTERN_INLINE],
 [
-  AC_REQUIRE([AC_C_INLINE])
   AH_VERBATIM([extern_inline],
 [/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
    _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
@@ -17,11 +16,22 @@ AC_DEFUN([gl_EXTERN_INLINE],
      when FOO is an inline function in the header; see
      <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
    _GL_INLINE_HEADER_END contains useful stuff to put
-     in the same include file, after uses of _GL_INLINE.  */
-#if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__
+     in the same include file, after uses of _GL_INLINE.
+
+   Suppress extern inline with HP-UX cc, as it appears to be broken; see
+   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
+   Suppress the use of extern inline on Apple's platforms,
+   as Libc-825.25 (2012-09-19) is incompatible with it; see
+   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \
+     && !defined __APPLE__)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
 # if __GNUC_GNU_INLINE__
    /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
 #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
@@ -30,12 +40,12 @@ AC_DEFUN([gl_EXTERN_INLINE],
 # endif
 # define _GL_EXTERN_INLINE extern
 #else
-# define _GL_INLINE static inline
-# define _GL_EXTERN_INLINE static inline
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
 #endif
 
 #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
-# if __GNUC_STDC_INLINE__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
 #  define _GL_INLINE_HEADER_CONST_PRAGMA
 # else
 #  define _GL_INLINE_HEADER_CONST_PRAGMA \
diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4
index 1bb88c7..e0f2dfb 100644
--- a/gl/m4/fseeko.m4
+++ b/gl/m4/fseeko.m4
@@ -1,5 +1,5 @@
 # fseeko.m4 serial 16
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4
index 3ab3297..b2cf2ad 100644
--- a/gl/m4/fstat.m4
+++ b/gl/m4/fstat.m4
@@ -1,5 +1,5 @@
-# fstat.m4 serial 3
-dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# fstat.m4 serial 4
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -33,7 +33,4 @@ AC_DEFUN([gl_FUNC_FSTAT],
 ])
 
 # Prerequisites of lib/fstat.c.
-AC_DEFUN([gl_PREREQ_FSTAT],
-[
-  AC_REQUIRE([AC_C_INLINE])
-])
+AC_DEFUN([gl_PREREQ_FSTAT], [:])
diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4
index ed8d014..5acd752 100644
--- a/gl/m4/ftell.m4
+++ b/gl/m4/ftell.m4
@@ -1,5 +1,5 @@
 # ftell.m4 serial 3
-dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4
index ab7b548..678039e 100644
--- a/gl/m4/ftello.m4
+++ b/gl/m4/ftello.m4
@@ -1,5 +1,5 @@
 # ftello.m4 serial 11
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index f6902b5..50f4509 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,5 +1,5 @@
 # getopt.m4 serial 44
-dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/gettime.m4 b/gl/m4/gettime.m4
index 7d03d12..dc100de 100644
--- a/gl/m4/gettime.m4
+++ b/gl/m4/gettime.m4
@@ -1,5 +1,5 @@
 # gettime.m4 serial 8
-dnl Copyright (C) 2002, 2004-2006, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004-2006, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4
index eda9702..3c05e59 100644
--- a/gl/m4/gettimeofday.m4
+++ b/gl/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
 # serial 20
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 6bea3f6..8d2d0b9 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 15d2b2b..0ae5a9e 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
 # gnulib-common.m4 serial 33
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -294,6 +294,8 @@ Amsterdam
 # for interoperability with automake-1.9.6 from autoconf-2.62.
 # Remove this macro when we can assume autoconf >= 2.62 or
 # autoconf >= 2.60 && automake >= 1.10.
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
 m4_ifdef([AC_PROG_MKDIR_P], [
   dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
   m4_define([AC_PROG_MKDIR_P],
@@ -304,13 +306,15 @@ m4_ifdef([AC_PROG_MKDIR_P], [
     [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
      MKDIR_P='$(mkdir_p)'
      AC_SUBST([MKDIR_P])])])
+])
 
 # AC_C_RESTRICT
 # This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
 # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
 # works.
 # This definition can be removed once autoconf >= 2.62 can be assumed.
-m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index afaabe3..90e6dcf 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -407,6 +407,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/time.in.h
   lib/timespec.c
   lib/timespec.h
+  lib/unistd.c
   lib/unistd.in.h
   lib/version-etc-fsf.c
   lib/version-etc.c
diff --git a/gl/m4/gnulib-tool.m4 b/gl/m4/gnulib-tool.m4
index a09ffc1..f3dea1a 100644
--- a/gl/m4/gnulib-tool.m4
+++ b/gl/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index a60a261..108d945 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
 # include_next.m4 serial 23
-dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
index a88850a..1e605e3 100644
--- a/gl/m4/largefile.m4
+++ b/gl/m4/largefile.m4
@@ -1,13 +1,14 @@
 # Enable large files on systems where this is not the default.
 
-# Copyright 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# The following implementation works around a problem in autoconf <= 2.68;
-# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
-m4_version_prereq([2.69], [] ,[
+# The following implementation works around a problem in autoconf <= 2.69;
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
+# or configures them incorrectly in some cases.
+m4_version_prereq([2.70], [] ,[
 
 # _AC_SYS_LARGEFILE_TEST_INCLUDES
 # -------------------------------
@@ -25,9 +26,9 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
 
 
 # _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
-#                              CACHE-VAR,
-#                              DESCRIPTION,
-#                              PROLOGUE, [FUNCTION-BODY])
+#                               CACHE-VAR,
+#                               DESCRIPTION,
+#                               PROLOGUE, [FUNCTION-BODY])
 # --------------------------------------------------------
 m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
 [AC_CACHE_CHECK([for $1 value needed for large files], [$3],
@@ -93,15 +94,11 @@ if test "$enable_largefile" != no; then
       [_AC_SYS_LARGEFILE_TEST_INCLUDES])
   fi
 
-  AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
-[/* Enable large inode numbers on Mac OS X.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif])
+  AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
+    [Enable large inode numbers on Mac OS X 10.5.])
 fi
 ])# AC_SYS_LARGEFILE
-
-])# m4_version_prereq 2.69
+])# m4_version_prereq 2.70
 
 # Enable large files on systems where this is implemented by Gnulib, not by the
 # system headers.
diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4
index b9c65c7..3af6ab5 100644
--- a/gl/m4/longlong.m4
+++ b/gl/m4/longlong.m4
@@ -1,5 +1,5 @@
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4
index bdda7f6..df9302a 100644
--- a/gl/m4/lseek.m4
+++ b/gl/m4/lseek.m4
@@ -1,5 +1,5 @@
 # lseek.m4 serial 10
-dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 8fa48e9..4b24a0b 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,5 +1,5 @@
 # malloc.m4 serial 14
-dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index 2760efb..45a30af 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 4
-dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# manywarnings.m4 serial 5
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -35,14 +35,12 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
 # make sure your gcc understands it.
 AC_DEFUN([gl_MANYWARN_ALL_GCC],
 [
-  dnl First, check if -Wno-missing-field-initializers is needed.
-  dnl -Wmissing-field-initializers is implied by -W, but that issues
-  dnl warnings with GCC version before 4.7, for the common idiom
-  dnl of initializing types on the stack to zero, using { 0, }
+  dnl First, check for some issues that only occur when combining multiple
+  dnl gcc warning categories.
   AC_REQUIRE([AC_PROG_CC])
   if test -n "$GCC"; then
 
-    dnl First, check -W -Werror -Wno-missing-field-initializers is supported
+    dnl Check if -W -Werror -Wno-missing-field-initializers is supported
     dnl with the current $CC $CFLAGS $CPPFLAGS.
     AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
     AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
@@ -77,8 +75,24 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
       ])
       AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
     fi
+
+    dnl Next, check if -Werror -Wuninitialized is useful with the
+    dnl user's choice of $CFLAGS; some versions of gcc warn that it
+    dnl has no effect if -O is not also used
+    AC_MSG_CHECKING([whether -Wuninitialized is supported])
+    AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Werror -Wuninitialized"
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[]], [[]])],
+        [gl_cv_cc_uninitialized_supported=yes],
+        [gl_cv_cc_uninitialized_supported=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
+
   fi
 
+  # List all gcc warning categories.
   gl_manywarn_set=
   for gl_manywarn_item in \
     -W \
@@ -197,10 +211,14 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
   done
 
-  # Disable the missing-field-initializers warning if needed
+  # Disable specific options as needed.
   if test "$gl_cv_cc_nomfi_needed" = yes; then
     gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
   fi
 
+  if test "$gl_cv_cc_uninitialized_supported" = no; then
+    gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
+  fi
+
   $1=$gl_manywarn_set
 ])
diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4
index 8db4617..9a6a47a 100644
--- a/gl/m4/msvc-inval.m4
+++ b/gl/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
 # msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4
index 0125050..a39618a 100644
--- a/gl/m4/msvc-nothrow.m4
+++ b/gl/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
 # msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index 0c288b8..552ec7e 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 7
-dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index c2638df..105b884 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -1,5 +1,5 @@
 # nocrash.m4 serial 4
-dnl Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4
index dfca2df..d355d01 100644
--- a/gl/m4/off_t.m4
+++ b/gl/m4/off_t.m4
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/read-file.m4 b/gl/m4/read-file.m4
index 3665247..491bba8 100644
--- a/gl/m4/read-file.m4
+++ b/gl/m4/read-file.m4
@@ -1,5 +1,5 @@
 # read-file.m4 serial 3
-dnl Copyright (C) 2002-2006, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index 954c2f0..d477fb4 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,5 +1,5 @@
 # realloc.m4 serial 13
-dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4
index 209d64c..6338134 100644
--- a/gl/m4/ssize_t.m4
+++ b/gl/m4/ssize_t.m4
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
index 5c313cb..c087f61 100644
--- a/gl/m4/stdarg.m4
+++ b/gl/m4/stdarg.m4
@@ -1,5 +1,5 @@
 # stdarg.m4 serial 6
-dnl Copyright (C) 2006, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
index cc11609..5da8ab1 100644
--- a/gl/m4/stddef_h.m4
+++ b/gl/m4/stddef_h.m4
@@ -1,6 +1,6 @@
 dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 4
-dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index 28d342e..27cdcdb 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
 # stdint.m4 serial 43
-dnl Copyright (C) 2001-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 5298dd6..ebade06 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 42
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# stdio_h.m4 serial 43
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is 
preserved.
 AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  AC_REQUIRE([AC_C_INLINE])
   gl_NEXT_HEADERS([stdio.h])
 
   dnl No need to create extra modules for these functions. Everyone who uses
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index ab43728..2027ab3 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 41
-dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 42
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,7 +22,7 @@ AC_DEFUN([gl_STDLIB_H],
     ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
     initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
     posix_openpt ptsname ptsname_r random random_r realpath rpmatch
-    setenv setstate setstate_r srandom srandom_r
+    secure_getenv setenv setstate setstate_r srandom srandom_r
     strtod strtoll strtoull unlockpt unsetenv])
 ])
 
@@ -60,6 +60,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
   GNULIB_REALPATH=0;      AC_SUBST([GNULIB_REALPATH])
   GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
+  GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
   GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
   GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
   GNULIB_STRTOLL=0;       AC_SUBST([GNULIB_STRTOLL])
@@ -88,6 +89,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
   HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
+  HAVE_SECURE_GETENV=1;      AC_SUBST([HAVE_SECURE_GETENV])
   HAVE_SETENV=1;             AC_SUBST([HAVE_SETENV])
   HAVE_DECL_SETENV=1;        AC_SUBST([HAVE_DECL_SETENV])
   HAVE_STRTOD=1;             AC_SUBST([HAVE_STRTOD])
@@ -102,6 +104,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   REPLACE_MALLOC=0;          AC_SUBST([REPLACE_MALLOC])
   REPLACE_MBTOWC=0;          AC_SUBST([REPLACE_MBTOWC])
   REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
+  REPLACE_PTSNAME=0;         AC_SUBST([REPLACE_PTSNAME])
   REPLACE_PTSNAME_R=0;       AC_SUBST([REPLACE_PTSNAME_R])
   REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
   REPLACE_RANDOM_R=0;        AC_SUBST([REPLACE_RANDOM_R])
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index 8d4e7e1..9486377 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 22
-dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 23
+dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,7 +10,6 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
 [
   AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AC_C_INLINE])
 
   dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
   dnl old-style declarations (with return type 'int' instead of 'ssize_t')
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index f45dee1..6dd3d99 100644
--- a/gl/m4/sys_stat_h.m4
+++ b/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 27   -*- Autoconf -*-
-dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 28   -*- Autoconf -*-
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,9 +11,6 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
 [
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
 
-  dnl For the mkdir substitute.
-  AC_REQUIRE([AC_C_INLINE])
-
   dnl Check for broken stat macros.
   AC_REQUIRE([AC_HEADER_STAT])
 
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
index c4a30cd..0ac71ac 100644
--- a/gl/m4/sys_time_h.m4
+++ b/gl/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/time.h>.
 # serial 8
 
-# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
index f11eef2..d15c1b3 100644
--- a/gl/m4/sys_types_h.m4
+++ b/gl/m4/sys_types_h.m4
@@ -1,10 +1,10 @@
-# sys_types_h.m4 serial 4
-dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 5
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_SYS_TYPES_H],
+AC_DEFUN_ONCE([gl_SYS_TYPES_H],
 [
   AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
   gl_NEXT_HEADERS([sys/types.h])
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index 6415bfb..3b83900 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -1,6 +1,6 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
 
 # serial 7
 
diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4
index 63c00e8..399404b 100644
--- a/gl/m4/timespec.m4
+++ b/gl/m4/timespec.m4
@@ -1,6 +1,6 @@
 #serial 15
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 7e7651b..32dcfa5 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 65
-dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# unistd_h.m4 serial 66
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,6 @@ AC_DEFUN([gl_UNISTD_H],
   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
   dnl once only, before all statements that occur in other macros.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
   if test $ac_cv_header_unistd_h = yes; then
diff --git a/gl/m4/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4
index 753d6fa..d5efeca 100644
--- a/gl/m4/valgrind-tests.m4
+++ b/gl/m4/valgrind-tests.m4
@@ -1,5 +1,5 @@
 # valgrind-tests.m4 serial 3
-dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/version-etc.m4 b/gl/m4/version-etc.m4
index 4c6c678..5dbef8e 100644
--- a/gl/m4/version-etc.m4
+++ b/gl/m4/version-etc.m4
@@ -1,5 +1,5 @@
 # version-etc.m4 serial 1
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
index a77802e..e43beeb 100644
--- a/gl/m4/warn-on-use.m4
+++ b/gl/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
 # warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index 28b8294..4b2ac38 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,5 +1,5 @@
 # warnings.m4 serial 7
-dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index 534735d..e1e1e69 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/malloc.c b/gl/malloc.c
index e0d5c89..908735d 100644
--- a/gl/malloc.c
+++ b/gl/malloc.c
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2013 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
diff --git a/gl/msvc-inval.c b/gl/msvc-inval.c
index ba76a7e..72a6b6e 100644
--- a/gl/msvc-inval.c
+++ b/gl/msvc-inval.c
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 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
diff --git a/gl/msvc-inval.h b/gl/msvc-inval.h
index eb6930b..dcb0353 100644
--- a/gl/msvc-inval.h
+++ b/gl/msvc-inval.h
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 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
diff --git a/gl/msvc-nothrow.c b/gl/msvc-nothrow.c
index e5cf181..8d65472 100644
--- a/gl/msvc-nothrow.c
+++ b/gl/msvc-nothrow.c
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 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
diff --git a/gl/msvc-nothrow.h b/gl/msvc-nothrow.h
index 2b71945..5f52181 100644
--- a/gl/msvc-nothrow.h
+++ b/gl/msvc-nothrow.h
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 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
diff --git a/gl/progname.c b/gl/progname.c
index bdd4dd7..0c195e5 100644
--- a/gl/progname.c
+++ b/gl/progname.c
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gl/progname.h b/gl/progname.h
index a75a02e..b4f3c27 100644
--- a/gl/progname.h
+++ b/gl/progname.h
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2004, 2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gl/read-file.c b/gl/read-file.c
index 87a7f36..bcc5a92 100644
--- a/gl/read-file.c
+++ b/gl/read-file.c
@@ -1,5 +1,5 @@
 /* read-file.c -- read file contents into a string
-   Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
    Written by Simon Josefsson and Bruno Haible.
 
    This program is free software; you can redistribute it and/or modify
@@ -26,11 +26,7 @@
 #include <stdio.h>
 
 /* Get SIZE_MAX.  */
-#ifdef __BIONIC__
-#include <limits.h>
-#else
 #include <stdint.h>
-#endif
 
 /* Get malloc, realloc, free. */
 #include <stdlib.h>
diff --git a/gl/read-file.h b/gl/read-file.h
index a1142b8..507135f 100644
--- a/gl/read-file.h
+++ b/gl/read-file.h
@@ -1,5 +1,5 @@
 /* read-file.h -- read file contents into a string
-   Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/gl/realloc.c b/gl/realloc.c
index 99556cc..b51010a 100644
--- a/gl/realloc.c
+++ b/gl/realloc.c
@@ -1,6 +1,6 @@
 /* realloc() function that is glibc compatible.
 
-   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2012 Free Software
+   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2013 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gl/stdarg.in.h b/gl/stdarg.in.h
index 53104a6..7484842 100644
--- a/gl/stdarg.in.h
+++ b/gl/stdarg.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <stdarg.h>.
-   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2013 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
diff --git a/gl/stddef.in.h b/gl/stddef.in.h
index 17fcaea..40f0536 100644
--- a/gl/stddef.in.h
+++ b/gl/stddef.in.h
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2009-2013 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
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 2f80268..2db8b2e 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2013 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h
index 920b4d4..e00600a 100644
--- a/gl/stdio-impl.h
+++ b/gl/stdio-impl.h
@@ -1,5 +1,5 @@
 /* Implementation details of FILE streams.
-   Copyright (C) 2007-2008, 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010-2013 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
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
index b1b543d..d6af99c 100644
--- a/gl/stdio.in.h
+++ b/gl/stdio.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2013 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
@@ -575,21 +575,17 @@ _GL_CXXALIAS_RPL (fwrite, size_t,
 _GL_CXXALIAS_SYS (fwrite, size_t,
                   (const void *ptr, size_t s, size_t n, FILE *stream));
 
-/* Work around glibc bug 11959
+/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
    <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
    which sometimes causes an unwanted diagnostic for fwrite calls.
-   This affects only function declaration attributes, so it's not
-   needed for C++.  */
-#  if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
-static inline size_t _GL_ARG_NONNULL ((1, 4))
-rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
-{
-  size_t r = fwrite (ptr, s, n, stream);
-  (void) r;
-  return r;
-}
+   This affects only function declaration attributes under certain
+   versions of gcc, and is not needed for C++.  */
+#  if (0 < __USE_FORTIFY_LEVEL                                          \
+       && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
+       && 3 < __GNUC__ + (4 <= __GNUC_MINOR__)                          \
+       && !defined __cplusplus)
 #   undef fwrite
-#   define fwrite rpl_fwrite
+#   define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
 #  endif
 # endif
 _GL_CXXALIASWARN (fwrite);
@@ -1333,7 +1329,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX 
compliant - "
                       "POSIX compliance");
 #endif
 
-
 #endif /* address@hidden@_STDIO_H */
 #endif /* address@hidden@_STDIO_H */
 #endif
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index 1d67ec6..c955248 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2012 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2013 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
@@ -20,8 +20,9 @@
 #endif
 @PRAGMA_COLUMNS@
 
-#if defined __need_malloc_and_calloc
-/* Special invocation convention inside glibc header files.  */
+#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+/* Special invocation conventions inside some gnulib header files,
+   and inside some glibc header files, respectively.  */
 
 address@hidden@ @NEXT_STDLIB_H@
 
@@ -457,10 +458,19 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not 
portable - "
 #if @GNULIB_PTSNAME@
 /* Return the pathname of the pseudo-terminal slave associated with
    the master FD is open on, or NULL on errors.  */
-# if address@hidden@
+# if @REPLACE_PTSNAME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ptsname
+#   define ptsname rpl_ptsname
+#  endif
+_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
+_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
+# endif
 _GL_CXXALIASWARN (ptsname);
 #elif defined GNULIB_POSIXCHECK
 # undef ptsname
@@ -757,6 +767,22 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
 # endif
 #endif
 
+#if @GNULIB_SECURE_GETENV@
+/* Look up NAME in the environment, returning 0 in insecure situations.  */
+# if address@hidden@
+_GL_FUNCDECL_SYS (secure_getenv, char *,
+                  (char const *name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
+_GL_CXXALIASWARN (secure_getenv);
+#elif defined GNULIB_POSIXCHECK
+# undef secure_getenv
+# if HAVE_RAW_DECL_SECURE_GETENV
+_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
+                 "use gnulib module secure_getenv for portability");
+# endif
+#endif
+
 #if @GNULIB_SETENV@
 /* Set NAME to VALUE in the environment.
    If REPLACE is nonzero, overwrite an existing value.  */
diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h
index 2efc1e9..acc3694 100644
--- a/gl/sys_stat.in.h
+++ b/gl/sys_stat.in.h
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2012 Free Software Foundation, Inc.
+   Copyright (C) 2005-2013 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
@@ -150,6 +150,10 @@
 # endif
 #endif
 
+#ifndef S_ISMPX /* AIX */
+# define S_ISMPX(m) 0
+#endif
+
 #ifndef S_ISNAM /* Xenix */
 # ifdef S_IFNAM
 #  define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
@@ -497,7 +501,7 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t 
mode));
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
 #  if !GNULIB_defined_rpl_mkdir
-static inline int
+static int
 rpl_mkdir (char const *name, mode_t mode)
 {
   return _mkdir (name);
diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
index d915cee..3dbf632 100644
--- a/gl/sys_time.in.h
+++ b/gl/sys_time.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2007-2013 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
@@ -17,37 +17,42 @@
 
 /* Written by Paul Eggert.  */
 
+#ifndef address@hidden@_SYS_TIME_H
+
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
-#if defined address@hidden@_SYS_TIME_H
-
-/* Simply delegate to the system's header, without adding anything.  */
-# if @HAVE_SYS_TIME_H@
-#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
-# endif
-
+/* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
+   Simply delegate to the system's header in this case; it is a no-op.
+   Without this extra ifdef, the C++ gettimeofday declaration below
+   would be a forward declaration in gnulib's nested <sys/time.h>.  */
+#ifdef _CYGWIN_SYS_TIME_H
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
 #else
 
-# define address@hidden@_SYS_TIME_H
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_SYS_TIME_H@
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+#endif
+
+#ifndef address@hidden@_SYS_TIME_H
+#define address@hidden@_SYS_TIME_H
 
-# if @HAVE_SYS_TIME_H@
-#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
-# else
-#  include <time.h>
-# endif
+#if ! @HAVE_SYS_TIME_H@
+# include <time.h>
+#endif
 
 /* On native Windows with MSVC, get the 'struct timeval' type.
    Also, on native Windows with a 64-bit time_t, where we are overriding the
    'struct timeval' type, get all declarations of system functions whose
    signature contains 'struct timeval'.  */
-# if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && 
!defined _GL_INCLUDING_WINSOCK2_H
-#  define _GL_INCLUDING_WINSOCK2_H
-#  include <winsock2.h>
-#  undef _GL_INCLUDING_WINSOCK2_H
-# endif
+#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && 
!defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
@@ -55,112 +60,112 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
-# ifdef __cplusplus
+#ifdef __cplusplus
 extern "C" {
-# endif
+#endif
 
-# if address@hidden@ || @REPLACE_STRUCT_TIMEVAL@
+#if address@hidden@ || @REPLACE_STRUCT_TIMEVAL@
 
-#  if @REPLACE_STRUCT_TIMEVAL@
-#   define timeval rpl_timeval
-#  endif
+# if @REPLACE_STRUCT_TIMEVAL@
+#  define timeval rpl_timeval
+# endif
 
-#  if !GNULIB_defined_struct_timeval
+# if !GNULIB_defined_struct_timeval
 struct timeval
 {
   time_t tv_sec;
   long int tv_usec;
 };
-#   define GNULIB_defined_struct_timeval 1
-#  endif
-
+#  define GNULIB_defined_struct_timeval 1
 # endif
 
-# ifdef __cplusplus
+#endif
+
+#ifdef __cplusplus
 }
-# endif
+#endif
 
-# if @GNULIB_GETTIMEOFDAY@
-#  if @REPLACE_GETTIMEOFDAY@
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#    undef gettimeofday
-#    define gettimeofday rpl_gettimeofday
-#   endif
+#if @GNULIB_GETTIMEOFDAY@
+# if @REPLACE_GETTIMEOFDAY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gettimeofday
+#   define gettimeofday rpl_gettimeofday
+#  endif
 _GL_FUNCDECL_RPL (gettimeofday, int,
                   (struct timeval *restrict, void *restrict)
                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (gettimeofday, int,
                   (struct timeval *restrict, void *restrict));
-#  else
-#   if address@hidden@
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (gettimeofday, int,
                   (struct timeval *restrict, void *restrict)
                   _GL_ARG_NONNULL ((1)));
-#   endif
+#  endif
 /* Need to cast, because on glibc systems, by default, the second argument is
                                                   struct timezone *.  */
 _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
                        (struct timeval *restrict, void *restrict));
-#  endif
+# endif
 _GL_CXXALIASWARN (gettimeofday);
-# elif defined GNULIB_POSIXCHECK
-#  undef gettimeofday
-#  if HAVE_RAW_DECL_GETTIMEOFDAY
+#elif defined GNULIB_POSIXCHECK
+# undef gettimeofday
+# if HAVE_RAW_DECL_GETTIMEOFDAY
 _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
                  "use gnulib module gettimeofday for portability");
-#  endif
 # endif
+#endif
 
 /* Hide some function declarations from <winsock2.h>.  */
 
-# if defined _MSC_VER && @HAVE_WINSOCK2_H@
-#  if !defined address@hidden@_UNISTD_H
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#    undef close
-#    define close close_used_without_including_unistd_h
-#   else
+#if defined _MSC_VER && @HAVE_WINSOCK2_H@
+# if !defined address@hidden@_UNISTD_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close close_used_without_including_unistd_h
+#  else
      _GL_WARN_ON_USE (close,
                       "close() used without including <unistd.h>");
-#   endif
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#    undef gethostname
-#    define gethostname gethostname_used_without_including_unistd_h
-#   else
+#  endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gethostname
+#   define gethostname gethostname_used_without_including_unistd_h
+#  else
      _GL_WARN_ON_USE (gethostname,
                       "gethostname() used without including <unistd.h>");
-#   endif
 #  endif
-#  if !defined address@hidden@_SYS_SOCKET_H
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#    undef socket
-#    define socket              socket_used_without_including_sys_socket_h
-#    undef connect
-#    define connect             connect_used_without_including_sys_socket_h
-#    undef accept
-#    define accept              accept_used_without_including_sys_socket_h
-#    undef bind
-#    define bind                bind_used_without_including_sys_socket_h
-#    undef getpeername
-#    define getpeername         getpeername_used_without_including_sys_socket_h
-#    undef getsockname
-#    define getsockname         getsockname_used_without_including_sys_socket_h
-#    undef getsockopt
-#    define getsockopt          getsockopt_used_without_including_sys_socket_h
-#    undef listen
-#    define listen              listen_used_without_including_sys_socket_h
-#    undef recv
-#    define recv                recv_used_without_including_sys_socket_h
-#    undef send
-#    define send                send_used_without_including_sys_socket_h
-#    undef recvfrom
-#    define recvfrom            recvfrom_used_without_including_sys_socket_h
-#    undef sendto
-#    define sendto              sendto_used_without_including_sys_socket_h
-#    undef setsockopt
-#    define setsockopt          setsockopt_used_without_including_sys_socket_h
-#    undef shutdown
-#    define shutdown            shutdown_used_without_including_sys_socket_h
-#   else
+# endif
+# if !defined address@hidden@_SYS_SOCKET_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef socket
+#   define socket              socket_used_without_including_sys_socket_h
+#   undef connect
+#   define connect             connect_used_without_including_sys_socket_h
+#   undef accept
+#   define accept              accept_used_without_including_sys_socket_h
+#   undef bind
+#   define bind                bind_used_without_including_sys_socket_h
+#   undef getpeername
+#   define getpeername         getpeername_used_without_including_sys_socket_h
+#   undef getsockname
+#   define getsockname         getsockname_used_without_including_sys_socket_h
+#   undef getsockopt
+#   define getsockopt          getsockopt_used_without_including_sys_socket_h
+#   undef listen
+#   define listen              listen_used_without_including_sys_socket_h
+#   undef recv
+#   define recv                recv_used_without_including_sys_socket_h
+#   undef send
+#   define send                send_used_without_including_sys_socket_h
+#   undef recvfrom
+#   define recvfrom            recvfrom_used_without_including_sys_socket_h
+#   undef sendto
+#   define sendto              sendto_used_without_including_sys_socket_h
+#   undef setsockopt
+#   define setsockopt          setsockopt_used_without_including_sys_socket_h
+#   undef shutdown
+#   define shutdown            shutdown_used_without_including_sys_socket_h
+#  else
      _GL_WARN_ON_USE (socket,
                       "socket() used without including <sys/socket.h>");
      _GL_WARN_ON_USE (connect,
@@ -189,17 +194,19 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is 
unportable - "
                       "setsockopt() used without including <sys/socket.h>");
      _GL_WARN_ON_USE (shutdown,
                       "shutdown() used without including <sys/socket.h>");
-#   endif
 #  endif
-#  if !defined address@hidden@_SYS_SELECT_H
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#    undef select
-#    define select select_used_without_including_sys_select_h
-#   else
+# endif
+# if !defined address@hidden@_SYS_SELECT_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef select
+#   define select select_used_without_including_sys_select_h
+#  else
      _GL_WARN_ON_USE (select,
                       "select() used without including <sys/select.h>");
-#   endif
 #  endif
 # endif
+#endif
 
 #endif /* address@hidden@_SYS_TIME_H */
+#endif /* _CYGWIN_SYS_TIME_H */
+#endif /* address@hidden@_SYS_TIME_H */
diff --git a/gl/sys_types.in.h b/gl/sys_types.in.h
index 8139d98..d7da356 100644
--- a/gl/sys_types.in.h
+++ b/gl/sys_types.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 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
diff --git a/gl/time.in.h b/gl/time.in.h
index 04cde05..8ced794 100644
--- a/gl/time.in.h
+++ b/gl/time.in.h
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2007-2013 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
diff --git a/gl/timespec.h b/gl/timespec.h
index d0a2194..d665e6c 100644
--- a/gl/timespec.h
+++ b/gl/timespec.h
@@ -1,6 +1,6 @@
 /* timespec -- System time interface
 
-   Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2012 Free Software
+   Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2013 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gl/unistd.c b/gl/unistd.c
new file mode 100644
index 0000000..6c6a8e2
--- /dev/null
+++ b/gl/unistd.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index e904e51..2ea9af4 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2013 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
@@ -14,29 +14,13 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef address@hidden@_UNISTD_H
+
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
-/* Special invocation convention:
-   - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
-     but we need to ensure that both the system <unistd.h> and <winsock2.h>
-     are completely included before we replace gethostname.  */
-#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
-  && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
-/* <unistd.h> is being indirectly included for the first time from
-   <winsock2.h>; avoid declaring any overrides.  */
-# if @HAVE_UNISTD_H@
-#  @INCLUDE_NEXT@ @NEXT_UNISTD_H@
-# else
-#  error unexpected; report this to address@hidden
-# endif
-# define _GL_WINSOCK2_H_WITNESS
-
-/* Normal invocation.  */
-#elif !defined address@hidden@_UNISTD_H
-
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
@@ -77,9 +61,13 @@
 /* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
    <unistd.h>.  */
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
+/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
+   included here.  */
 /* But avoid namespace pollution on glibc systems.  */
-#ifndef __GLIBC__
+#if !defined __GLIBC__ && !defined __osf__
+# define __need_system_stdlib_h
 # include <stdlib.h>
+# undef __need_system_stdlib_h
 #endif
 
 /* Native Windows platforms declare chdir, getcwd, rmdir in
@@ -124,9 +112,15 @@
 /* Get getopt(), optarg, optind, opterr, optopt.
    But avoid namespace pollution on glibc systems.  */
 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined 
_GL_SYSTEM_GETOPT
+# define __need_getopt
 # include <getopt.h>
 #endif
 
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_UNISTD_INLINE
+# define _GL_UNISTD_INLINE _GL_INLINE
+#endif
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
@@ -404,7 +398,7 @@ extern char **environ;
 # endif
 #elif defined GNULIB_POSIXCHECK
 # if HAVE_RAW_DECL_ENVIRON
-static inline char ***
+_GL_UNISTD_INLINE char ***
 rpl_environ (void)
 {
   return &environ;
@@ -862,7 +856,7 @@ _GL_CXXALIAS_RPL (getpagesize, int, (void));
 #     define getpagesize() _gl_getpagesize ()
 #    else
 #     if !GNULIB_defined_getpagesize_function
-static inline int
+_GL_UNISTD_INLINE int
 getpagesize ()
 {
   return _gl_getpagesize ();
@@ -1530,6 +1524,7 @@ _GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const 
void *buf, size_t count));
 _GL_CXXALIASWARN (write);
 #endif
 
+_GL_INLINE_HEADER_END
 
 #endif /* address@hidden@_UNISTD_H */
 #endif /* address@hidden@_UNISTD_H */
diff --git a/gl/version-etc-fsf.c b/gl/version-etc-fsf.c
index c452f40..e1c69da 100644
--- a/gl/version-etc-fsf.c
+++ b/gl/version-etc-fsf.c
@@ -1,5 +1,5 @@
 /* Variable with FSF copyright information, for version-etc.
-   Copyright (C) 1999-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1999-2006, 2009-2013 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
diff --git a/gl/version-etc.c b/gl/version-etc.c
index ae1e44d..b7d23ab 100644
--- a/gl/version-etc.c
+++ b/gl/version-etc.c
@@ -1,5 +1,5 @@
 /* Print --version and bug-reporting information in a consistent format.
-   Copyright (C) 1999-2012 Free Software Foundation, Inc.
+   Copyright (C) 1999-2013 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
@@ -38,7 +38,7 @@
 # define PACKAGE PACKAGE_TARNAME
 #endif
 
-enum { COPYRIGHT_YEAR = 2012 };
+enum { COPYRIGHT_YEAR = 2013 };
 
 /* The three functions below display the --version information the
    standard way.
diff --git a/gl/version-etc.h b/gl/version-etc.h
index 5548c02..6c3d084 100644
--- a/gl/version-etc.h
+++ b/gl/version-etc.h
@@ -1,5 +1,5 @@
 /* Print --version and bug-reporting information in a consistent format.
-   Copyright (C) 1999, 2003, 2005, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003, 2005, 2009-2013 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
diff --git a/lib/ASN1.c b/lib/ASN1.c
index df6fb64..f9a9d18 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -77,7 +77,7 @@
 #line 1 "ASN1.y"
 
 /*
- * Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -3285,8 +3285,7 @@ _asn1_yyerror (const char *s)
     {
       snprintf (last_error_token, sizeof(last_error_token),
                 "%s", last_token);
-      fprintf(stderr, 
-               "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
+      fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
                file_name, line_number, last_token);
       return;
     }
diff --git a/lib/ASN1.y b/lib/ASN1.y
index e0add54..4934215 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -1,6 +1,6 @@
 %{
 /*
- * Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -871,8 +871,7 @@ _asn1_yyerror (const char *s)
     {
       snprintf (last_error_token, sizeof(last_error_token),
                 "%s", last_token);
-      fprintf(stderr, 
-               "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
+      fprintf(stderr, "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
                file_name, line_number, last_token);
       return;
     }
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 2ea4c09..7b3e570 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/lib/coding.c b/lib/coding.c
index b83b61a..8dd6ae0 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -140,9 +140,9 @@ _asn1_tag_der (unsigned char class, unsigned int tag_value,
        {
          temp[k++] = tag_value & 0x7F;
          tag_value >>= 7;
-         
-         if (k > ASN1_MAX_TAG_SIZE-1)
-           break; /* will not encode larger tags */
+
+         if (k > ASN1_MAX_TAG_SIZE - 1)
+           break;              /* will not encode larger tags */
        }
       *ans_len = k + 1;
       while (k--)
@@ -192,52 +192,52 @@ asn1_octet_der (const unsigned char *str, int str_len,
  * @tl_len: the bytes of the @tl field
  *
  * Creates the DER encoding for various simple ASN.1 types like strings etc.
- * It stores the tag and length in @tl, which should have space for at least 
+ * It stores the tag and length in @tl, which should have space for at least
  * %ASN1_MAX_TL_SIZE bytes. Initially @tl_len should contain the size of @tl.
  *
  * The complete DER encoding should consist of the value in @tl appended
  * with the provided @str.
  *
- * Returns: %ASN1_SUCCESS if successful or an error value. 
+ * Returns: %ASN1_SUCCESS if successful or an error value.
  **/
 int
-asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned 
int str_len,
-                        unsigned char *tl, unsigned int *tl_len)
+asn1_encode_simple_der (unsigned int etype, const unsigned char *str,
+                       unsigned int str_len, unsigned char *tl,
+                       unsigned int *tl_len)
 {
   int tag_len, len_len;
   unsigned tlen;
   unsigned char der_tag[ASN1_MAX_TAG_SIZE];
   unsigned char der_length[ASN1_MAX_LENGTH_SIZE];
-  unsigned char* p;
+  unsigned char *p;
 
   if (str == NULL)
     return ASN1_VALUE_NOT_VALID;
 
-  if (ETYPE_OK(etype) == 0)
+  if (ETYPE_OK (etype) == 0)
     return ASN1_VALUE_NOT_VALID;
 
   /* doesn't handle constructed classes */
-  if (ETYPE_CLASS(etype) != ASN1_CLASS_UNIVERSAL)
+  if (ETYPE_CLASS (etype) != ASN1_CLASS_UNIVERSAL)
     return ASN1_VALUE_NOT_VALID;
 
-  _asn1_tag_der (ETYPE_CLASS(etype), ETYPE_TAG(etype),
-                der_tag, &tag_len);
+  _asn1_tag_der (ETYPE_CLASS (etype), ETYPE_TAG (etype), der_tag, &tag_len);
 
-  asn1_length_der(str_len, der_length, &len_len);
+  asn1_length_der (str_len, der_length, &len_len);
 
   if (tag_len <= 0 || len_len <= 0)
     return ASN1_VALUE_NOT_VALID;
-  
+
   tlen = tag_len + len_len;
 
   if (*tl_len < tlen)
     return ASN1_MEM_ERROR;
 
   p = tl;
-  memcpy(p, der_tag, tag_len);
-  p+=tag_len;
-  memcpy(p, der_length, len_len);
-  
+  memcpy (p, der_tag, tag_len);
+  p += tag_len;
+  memcpy (p, der_length, len_len);
+
   *tl_len = tlen;
 
   return ASN1_SUCCESS;
@@ -258,7 +258,8 @@ asn1_encode_simple_der (unsigned int etype, const unsigned 
char *str, unsigned i
 /*   ASN1_SUCCESS otherwise                           */
 /******************************************************/
 static int
-_asn1_time_der (unsigned char *str, int str_len, unsigned char *der, int 
*der_len)
+_asn1_time_der (unsigned char *str, int str_len, unsigned char *der,
+               int *der_len)
 {
   int len_len;
   int max_len;
@@ -517,33 +518,56 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned 
char *der,
   return ASN1_SUCCESS;
 }
 
-const tag_and_class_st _asn1_tags[] =
-{
-  [ASN1_ETYPE_GENERALSTRING] = {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL, 
"type:GENERALSTRING"},
-  [ASN1_ETYPE_NUMERIC_STRING] = {ASN1_TAG_NUMERIC_STRING, 
ASN1_CLASS_UNIVERSAL, "type:NUMERIC_STR"},
-  [ASN1_ETYPE_IA5_STRING] =     {ASN1_TAG_IA5_STRING, ASN1_CLASS_UNIVERSAL, 
"type:IA5_STR"},
-  [ASN1_ETYPE_TELETEX_STRING] = {ASN1_TAG_TELETEX_STRING, 
ASN1_CLASS_UNIVERSAL, "type:TELETEX_STR"},
-  [ASN1_ETYPE_PRINTABLE_STRING] = {ASN1_TAG_PRINTABLE_STRING, 
ASN1_CLASS_UNIVERSAL, "type:PRINTABLE_STR"},
-  [ASN1_ETYPE_UNIVERSAL_STRING] = {ASN1_TAG_UNIVERSAL_STRING, 
ASN1_CLASS_UNIVERSAL, "type:UNIVERSAL_STR"},
-  [ASN1_ETYPE_BMP_STRING] =       {ASN1_TAG_BMP_STRING, ASN1_CLASS_UNIVERSAL, 
"type:BMP_STR"},
-  [ASN1_ETYPE_UTF8_STRING] =      {ASN1_TAG_UTF8_STRING, ASN1_CLASS_UNIVERSAL, 
"type:UTF8_STR"},
-  [ASN1_ETYPE_VISIBLE_STRING] =   {ASN1_TAG_VISIBLE_STRING, 
ASN1_CLASS_UNIVERSAL, "type:VISIBLE_STR"},
-  [ASN1_ETYPE_OCTET_STRING] =    {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL, 
"type:OCT_STR"},
-  [ASN1_ETYPE_BIT_STRING] = {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL, 
"type:BIT_STR"},
-  [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL, 
"type:OBJ_ID"},
-  [ASN1_ETYPE_NULL] =       {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL, "type:NULL"},
-  [ASN1_ETYPE_BOOLEAN] =    {ASN1_TAG_BOOLEAN, ASN1_CLASS_UNIVERSAL, 
"type:BOOLEAN"},
-  [ASN1_ETYPE_INTEGER] =    {ASN1_TAG_INTEGER, ASN1_CLASS_UNIVERSAL, 
"type:INTEGER"},
-  [ASN1_ETYPE_ENUMERATED] = {ASN1_TAG_ENUMERATED, ASN1_CLASS_UNIVERSAL, 
"type:ENUMERATED"},
-  [ASN1_ETYPE_SEQUENCE] =   {ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | 
ASN1_CLASS_STRUCTURED, "type:SEQUENCE"},
-  [ASN1_ETYPE_SEQUENCE_OF] ={ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | 
ASN1_CLASS_STRUCTURED, "type:SEQ_OF"},
-  [ASN1_ETYPE_SET] =        {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | 
ASN1_CLASS_STRUCTURED, "type:SET"},
-  [ASN1_ETYPE_SET_OF] =     {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | 
ASN1_CLASS_STRUCTURED, "type:SET_OF"},
-  [ASN1_ETYPE_GENERALIZED_TIME] = {ASN1_TAG_GENERALIZEDTime, 
ASN1_CLASS_UNIVERSAL, "type:GENERALIZED_TIME"},
-  [ASN1_ETYPE_UTC_TIME] = {ASN1_TAG_UTCTime, ASN1_CLASS_UNIVERSAL, 
"type:UTC_TIME"},
+const tag_and_class_st _asn1_tags[] = {
+  [ASN1_ETYPE_GENERALSTRING] =
+    {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL, "type:GENERALSTRING"},
+  [ASN1_ETYPE_NUMERIC_STRING] =
+    {ASN1_TAG_NUMERIC_STRING, ASN1_CLASS_UNIVERSAL, "type:NUMERIC_STR"},
+  [ASN1_ETYPE_IA5_STRING] =
+    {ASN1_TAG_IA5_STRING, ASN1_CLASS_UNIVERSAL, "type:IA5_STR"},
+  [ASN1_ETYPE_TELETEX_STRING] =
+    {ASN1_TAG_TELETEX_STRING, ASN1_CLASS_UNIVERSAL, "type:TELETEX_STR"},
+  [ASN1_ETYPE_PRINTABLE_STRING] =
+    {ASN1_TAG_PRINTABLE_STRING, ASN1_CLASS_UNIVERSAL, "type:PRINTABLE_STR"},
+  [ASN1_ETYPE_UNIVERSAL_STRING] =
+    {ASN1_TAG_UNIVERSAL_STRING, ASN1_CLASS_UNIVERSAL, "type:UNIVERSAL_STR"},
+  [ASN1_ETYPE_BMP_STRING] =
+    {ASN1_TAG_BMP_STRING, ASN1_CLASS_UNIVERSAL, "type:BMP_STR"},
+  [ASN1_ETYPE_UTF8_STRING] =
+    {ASN1_TAG_UTF8_STRING, ASN1_CLASS_UNIVERSAL, "type:UTF8_STR"},
+  [ASN1_ETYPE_VISIBLE_STRING] =
+    {ASN1_TAG_VISIBLE_STRING, ASN1_CLASS_UNIVERSAL, "type:VISIBLE_STR"},
+  [ASN1_ETYPE_OCTET_STRING] =
+    {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL, "type:OCT_STR"},
+  [ASN1_ETYPE_BIT_STRING] =
+    {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL, "type:BIT_STR"},
+  [ASN1_ETYPE_OBJECT_ID] =
+    {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL, "type:OBJ_ID"},
+  [ASN1_ETYPE_NULL] = {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL, "type:NULL"},
+  [ASN1_ETYPE_BOOLEAN] =
+    {ASN1_TAG_BOOLEAN, ASN1_CLASS_UNIVERSAL, "type:BOOLEAN"},
+  [ASN1_ETYPE_INTEGER] =
+    {ASN1_TAG_INTEGER, ASN1_CLASS_UNIVERSAL, "type:INTEGER"},
+  [ASN1_ETYPE_ENUMERATED] =
+    {ASN1_TAG_ENUMERATED, ASN1_CLASS_UNIVERSAL, "type:ENUMERATED"},
+  [ASN1_ETYPE_SEQUENCE] =
+    {ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
+     "type:SEQUENCE"},
+  [ASN1_ETYPE_SEQUENCE_OF] =
+    {ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
+     "type:SEQ_OF"},
+  [ASN1_ETYPE_SET] =
+    {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET"},
+  [ASN1_ETYPE_SET_OF] =
+    {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
+     "type:SET_OF"},
+  [ASN1_ETYPE_GENERALIZED_TIME] =
+    {ASN1_TAG_GENERALIZEDTime, ASN1_CLASS_UNIVERSAL, "type:GENERALIZED_TIME"},
+  [ASN1_ETYPE_UTC_TIME] =
+    {ASN1_TAG_UTCTime, ASN1_CLASS_UNIVERSAL, "type:UTC_TIME"},
 };
 
-unsigned int _asn1_tags_size = sizeof(_asn1_tags)/sizeof(_asn1_tags[0]);
+unsigned int _asn1_tags_size = sizeof (_asn1_tags) / sizeof (_asn1_tags[0]);
 
 /******************************************************/
 /* Function : _asn1_insert_tag_der                    */
@@ -613,9 +637,9 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, 
int *counter,
                  if (!is_tag_implicit)
                    {
                      if ((type_field (node->type) == ASN1_ETYPE_SEQUENCE) ||
-                         (type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF) ||
-                         (type_field (node->type) == ASN1_ETYPE_SET) ||
-                         (type_field (node->type) == ASN1_ETYPE_SET_OF))
+                         (type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF)
+                         || (type_field (node->type) == ASN1_ETYPE_SET)
+                         || (type_field (node->type) == ASN1_ETYPE_SET_OF))
                        class |= ASN1_CLASS_STRUCTURED;
                      class_implicit = class;
                      tag_implicit = _asn1_strtoul (p->value, NULL, 10);
@@ -636,7 +660,7 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, 
int *counter,
       unsigned type = type_field (node->type);
       switch (type)
        {
-        CASE_HANDLED_ETYPES:
+       CASE_HANDLED_ETYPES:
          _asn1_tag_der (_asn1_tags[type].class, _asn1_tags[type].tag,
                         tag_der, &tag_len);
          break;
diff --git a/lib/decoding.c b/lib/decoding.c
index c522c5d..eb83d89 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -85,14 +85,14 @@ asn1_get_length_der (const unsigned char *der, int der_len, 
int *len)
          ans = 0;
          while (punt <= k && punt < der_len)
            {
-              if (INT_MULTIPLY_OVERFLOW (ans, 256))
-                return -2;
-              ans *= 256;
+             if (INT_MULTIPLY_OVERFLOW (ans, 256))
+               return -2;
+             ans *= 256;
 
-              if (INT_ADD_OVERFLOW (ans, ((unsigned)der[punt])))
-                return -2;
+             if (INT_ADD_OVERFLOW (ans, ((unsigned) der[punt])))
+               return -2;
              ans += der[punt];
-              punt++;
+             punt++;
            }
        }
       else
@@ -108,8 +108,8 @@ asn1_get_length_der (const unsigned char *der, int der_len, 
int *len)
   if (ans >= INT_MAX || INT_ADD_OVERFLOW (sum, (*len)))
     return -2;
   sum += *len;
-  
-  if (sum > (unsigned)der_len)
+
+  if (sum > der_len)
     return -4;
 
   return ans;
@@ -152,28 +152,28 @@ asn1_get_tag_der (const unsigned char *der, int der_len,
       while (punt <= der_len && der[punt] & 128)
        {
 
-          if (INT_MULTIPLY_OVERFLOW (ris, 128))
-            return ASN1_DER_ERROR;
-          ris *= 128;
+         if (INT_MULTIPLY_OVERFLOW (ris, 128))
+           return ASN1_DER_ERROR;
+         ris *= 128;
 
-          if (INT_ADD_OVERFLOW (ris, ((unsigned)(der[punt] & 0x7F))))
-            return ASN1_DER_ERROR;
-          ris += (der[punt] & 0x7F);
-          punt++;
+         if (INT_ADD_OVERFLOW (ris, ((unsigned) (der[punt] & 0x7F))))
+           return ASN1_DER_ERROR;
+         ris += (der[punt] & 0x7F);
+         punt++;
        }
 
       if (punt >= der_len)
        return ASN1_DER_ERROR;
 
       if (INT_MULTIPLY_OVERFLOW (ris, 128))
-        return ASN1_DER_ERROR;
+       return ASN1_DER_ERROR;
       ris *= 128;
 
-      if (INT_ADD_OVERFLOW (ris, ((unsigned)(der[punt] & 0x7F))))
-        return ASN1_DER_ERROR;
+      if (INT_ADD_OVERFLOW (ris, ((unsigned) (der[punt] & 0x7F))))
+       return ASN1_DER_ERROR;
       ris += (der[punt] & 0x7F);
       punt++;
-  
+
       *len = punt;
     }
 
@@ -282,7 +282,7 @@ _asn1_get_objectid_der (const unsigned char *der, int 
der_len, int *ret_len,
   int len_len, len, k;
   int leading;
   char temp[20];
-  unsigned long val, val1, prev_val;
+  unsigned long val, val1;
 
   *ret_len = 0;
   if (str && str_size > 0)
@@ -303,7 +303,6 @@ _asn1_get_objectid_der (const unsigned char *der, int 
der_len, int *ret_len,
   _asn1_str_cat (str, str_size, ".");
   _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
 
-  prev_val = 0;
   val = 0;
   leading = 1;
   for (k = 1; k < len; k++)
@@ -315,9 +314,9 @@ _asn1_get_objectid_der (const unsigned char *der, int 
der_len, int *ret_len,
       leading = 0;
 
       /* check for wrap around */
-      if (INT_LEFT_SHIFT_OVERFLOW(val, 7))
-        return ASN1_DER_ERROR;
-      
+      if (INT_LEFT_SHIFT_OVERFLOW (val, 7))
+       return ASN1_DER_ERROR;
+
       val = val << 7;
       val |= der[len_len + k] & 0x7F;
 
@@ -326,14 +325,13 @@ _asn1_get_objectid_der (const unsigned char *der, int 
der_len, int *ret_len,
          _asn1_str_cat (str, str_size, ".");
          _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
          val = 0;
-         prev_val = 0;
          leading = 1;
        }
     }
-  
-  if (INT_ADD_OVERFLOW(len, len_len))
+
+  if (INT_ADD_OVERFLOW (len, len_len))
     return ASN1_DER_ERROR;
-  
+
   *ret_len = len + len_len;
 
   return ASN1_SUCCESS;
@@ -447,9 +445,9 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char 
*der, int der_len,
                  if (!is_tag_implicit)
                    {
                      if ((type_field (node->type) == ASN1_ETYPE_SEQUENCE) ||
-                         (type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF) ||
-                         (type_field (node->type) == ASN1_ETYPE_SET) ||
-                         (type_field (node->type) == ASN1_ETYPE_SET_OF))
+                         (type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF)
+                         || (type_field (node->type) == ASN1_ETYPE_SET)
+                         || (type_field (node->type) == ASN1_ETYPE_SET_OF))
                        class2 |= ASN1_CLASS_STRUCTURED;
                      class_implicit = class2;
                      tag_implicit = strtoul ((char *) p->value, NULL, 10);
@@ -523,7 +521,8 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char 
*der, int der_len,
        case ASN1_ETYPE_SET_OF:
        case ASN1_ETYPE_GENERALIZED_TIME:
        case ASN1_ETYPE_UTC_TIME:
-         if ((class != _asn1_tags[type].class) || (tag != 
_asn1_tags[type].tag))
+         if ((class != _asn1_tags[type].class)
+             || (tag != _asn1_tags[type].tag))
            return ASN1_DER_ERROR;
          break;
 
@@ -1076,14 +1075,14 @@ asn1_der_decoding (asn1_node * element, const void 
*ider, int len,
              move = RIGHT;
              break;
            case ASN1_ETYPE_GENERALSTRING:
-            case ASN1_ETYPE_NUMERIC_STRING:
-            case ASN1_ETYPE_IA5_STRING:
-            case ASN1_ETYPE_TELETEX_STRING:
-            case ASN1_ETYPE_PRINTABLE_STRING:
-            case ASN1_ETYPE_UNIVERSAL_STRING:
-            case ASN1_ETYPE_BMP_STRING:
-            case ASN1_ETYPE_UTF8_STRING:
-            case ASN1_ETYPE_VISIBLE_STRING:
+           case ASN1_ETYPE_NUMERIC_STRING:
+           case ASN1_ETYPE_IA5_STRING:
+           case ASN1_ETYPE_TELETEX_STRING:
+           case ASN1_ETYPE_PRINTABLE_STRING:
+           case ASN1_ETYPE_UNIVERSAL_STRING:
+           case ASN1_ETYPE_BMP_STRING:
+           case ASN1_ETYPE_UTF8_STRING:
+           case ASN1_ETYPE_VISIBLE_STRING:
            case ASN1_ETYPE_BIT_STRING:
              len2 =
                asn1_get_length_der (der + counter, len - counter, &len3);
@@ -1755,14 +1754,14 @@ asn1_der_decoding_element (asn1_node * structure, const 
char *elementName,
              move = RIGHT;
              break;
            case ASN1_ETYPE_GENERALSTRING:
-            case ASN1_ETYPE_NUMERIC_STRING:
-            case ASN1_ETYPE_IA5_STRING:
-            case ASN1_ETYPE_TELETEX_STRING:
-            case ASN1_ETYPE_PRINTABLE_STRING:
-            case ASN1_ETYPE_UNIVERSAL_STRING:
-            case ASN1_ETYPE_BMP_STRING:
-            case ASN1_ETYPE_UTF8_STRING:
-            case ASN1_ETYPE_VISIBLE_STRING:
+           case ASN1_ETYPE_NUMERIC_STRING:
+           case ASN1_ETYPE_IA5_STRING:
+           case ASN1_ETYPE_TELETEX_STRING:
+           case ASN1_ETYPE_PRINTABLE_STRING:
+           case ASN1_ETYPE_UNIVERSAL_STRING:
+           case ASN1_ETYPE_BMP_STRING:
+           case ASN1_ETYPE_UTF8_STRING:
+           case ASN1_ETYPE_VISIBLE_STRING:
            case ASN1_ETYPE_BIT_STRING:
              len2 =
                asn1_get_length_der (der + counter, len - counter, &len3);
@@ -1932,7 +1931,8 @@ asn1_der_decoding_element (asn1_node * structure, const 
char *elementName,
                            _asn1_set_value (p, temp, tlen + 1);
                          p2 = p->down;
                          while ((type_field (p2->type) == ASN1_ETYPE_TAG)
-                                || (type_field (p2->type) == ASN1_ETYPE_SIZE))
+                                || (type_field (p2->type) ==
+                                    ASN1_ETYPE_SIZE))
                            p2 = p2->right;
                          if (p2->right == NULL)
                            _asn1_append_sequence_set (p);
@@ -2218,7 +2218,7 @@ asn1_der_decoding_startEnd (asn1_node element, const void 
*ider, int len,
   while (1)
     {
       if (p == NULL)
-        return ASN1_DER_ERROR;
+       return ASN1_DER_ERROR;
 
       ris = ASN1_SUCCESS;
 
@@ -2227,8 +2227,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void 
*ider, int len,
          if (p->type & CONST_SET)
            {
              p2 = _asn1_find_up (p);
-              if (p2 == NULL)
-                return ASN1_DER_ERROR;
+             if (p2 == NULL)
+               return ASN1_DER_ERROR;
 
              len2 = _asn1_strtol (p2->value, NULL, 10);
              if (len2 == -1)
@@ -2263,8 +2263,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void 
*ider, int len,
                      else
                        {
                          p3 = p2->down;
-                          if (p3 == NULL)
-                            return ASN1_DER_ERROR;
+                         if (p3 == NULL)
+                           return ASN1_DER_ERROR;
 
                          ris =
                            _asn1_extract_tag_der (p3, der + counter,
@@ -2289,8 +2289,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void 
*ider, int len,
          if (type_field (p->type) == ASN1_ETYPE_CHOICE)
            {
              p = p->down;
-              if (p == NULL)
-                return ASN1_DER_ERROR;
+             if (p == NULL)
+               return ASN1_DER_ERROR;
 
              ris =
                _asn1_extract_tag_der (p, der + counter, len - counter,
@@ -2352,14 +2352,14 @@ asn1_der_decoding_startEnd (asn1_node element, const 
void *ider, int len,
            case ASN1_ETYPE_INTEGER:
            case ASN1_ETYPE_ENUMERATED:
            case ASN1_ETYPE_GENERALSTRING:
-            case ASN1_ETYPE_NUMERIC_STRING:
-            case ASN1_ETYPE_IA5_STRING:
-            case ASN1_ETYPE_TELETEX_STRING:
-            case ASN1_ETYPE_PRINTABLE_STRING:
-            case ASN1_ETYPE_UNIVERSAL_STRING:
-            case ASN1_ETYPE_BMP_STRING:
-            case ASN1_ETYPE_UTF8_STRING:
-            case ASN1_ETYPE_VISIBLE_STRING:
+           case ASN1_ETYPE_NUMERIC_STRING:
+           case ASN1_ETYPE_IA5_STRING:
+           case ASN1_ETYPE_TELETEX_STRING:
+           case ASN1_ETYPE_PRINTABLE_STRING:
+           case ASN1_ETYPE_UNIVERSAL_STRING:
+           case ASN1_ETYPE_BMP_STRING:
+           case ASN1_ETYPE_UTF8_STRING:
+           case ASN1_ETYPE_VISIBLE_STRING:
            case ASN1_ETYPE_BIT_STRING:
              len2 =
                asn1_get_length_der (der + counter, len - counter, &len3);
@@ -2587,8 +2587,8 @@ asn1_expand_any_defined_by (asn1_node definitions, 
asn1_node * element)
                      p3 = p3->right;
                    }
 
-                 if ((!p3) || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) 
||
-                     (p3->value == NULL))
+                 if ((!p3) || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID)
+                     || (p3->value == NULL))
                    {
                      retCode = ASN1_ERROR_TYPE_ANY;
                      break;
@@ -2878,14 +2878,15 @@ asn1_expand_octet_string (asn1_node definitions, 
asn1_node * element,
  * Decodes a simple DER encoded type (e.g. a string, which is not constructed).
  * The output is a pointer inside the @der.
  *
- * Returns: %ASN1_SUCCESS if successful or an error value. 
+ * Returns: %ASN1_SUCCESS if successful or an error value.
  **/
 int
-asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned 
int der_len,
-                        const unsigned char **str, unsigned int *str_len)
+asn1_decode_simple_der (unsigned int etype, const unsigned char *der,
+                       unsigned int der_len, const unsigned char **str,
+                       unsigned int *str_len)
 {
   int tag_len, len_len;
-  const unsigned char* p;
+  const unsigned char *p;
   unsigned char class;
   unsigned long tag;
   long ret;
@@ -2893,31 +2894,31 @@ asn1_decode_simple_der (unsigned int etype, const 
unsigned char *der, unsigned i
   if (der == NULL || der_len == 0)
     return ASN1_VALUE_NOT_VALID;
 
-  if (ETYPE_OK(etype) == 0)
+  if (ETYPE_OK (etype) == 0)
     return ASN1_VALUE_NOT_VALID;
 
   /* doesn't handle constructed classes */
-  if (ETYPE_CLASS(etype) != ASN1_CLASS_UNIVERSAL)
+  if (ETYPE_CLASS (etype) != ASN1_CLASS_UNIVERSAL)
     return ASN1_VALUE_NOT_VALID;
 
   p = der;
   ret = asn1_get_tag_der (p, der_len, &class, &tag_len, &tag);
   if (ret != ASN1_SUCCESS)
     return ret;
-  
-  if (class != ETYPE_CLASS(etype) || tag != ETYPE_TAG(etype))
+
+  if (class != ETYPE_CLASS (etype) || tag != ETYPE_TAG (etype))
     return ASN1_DER_ERROR;
 
   p += tag_len;
   der_len -= tag_len;
-  
+
   ret = asn1_get_length_der (p, der_len, &len_len);
-  if (ret < 0) 
+  if (ret < 0)
     return ASN1_DER_ERROR;
 
   p += len_len;
   der_len -= len_len;
-  
+
   *str_len = ret;
   *str = p;
 
diff --git a/lib/element.c b/lib/element.c
index 763ac58..8604c24 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -287,11 +287,10 @@ asn1_write_value (asn1_node node_root, const char *name,
       asn1_delete_structure (&node);
       return ASN1_SUCCESS;
     }
-  
-  type = type_field(node->type);
 
-  if ((type == ASN1_ETYPE_SEQUENCE_OF) && (value == NULL)
-      && (len == 0))
+  type = type_field (node->type);
+
+  if ((type == ASN1_ETYPE_SEQUENCE_OF) && (value == NULL) && (len == 0))
     {
       p = node->down;
       while ((type_field (p->type) == ASN1_ETYPE_TAG)
@@ -499,48 +498,48 @@ asn1_write_value (asn1_node node_root, const char *name,
       _asn1_set_value (node, value, _asn1_strlen (value) + 1);
       break;
     case ASN1_ETYPE_UTC_TIME:
-       {
-         len = _asn1_strlen(value);
-         if (len < 11)
+      {
+       len = _asn1_strlen (value);
+       if (len < 11)
+         return ASN1_VALUE_NOT_VALID;
+       for (k = 0; k < 10; k++)
+         if (!isdigit (value[k]))
            return ASN1_VALUE_NOT_VALID;
-         for (k = 0; k < 10; k++)
-           if (!isdigit (value[k]))
+       switch (len)
+         {
+         case 11:
+           if (value[10] != 'Z')
              return ASN1_VALUE_NOT_VALID;
-         switch (len)
-           {
-           case 11:
-             if (value[10] != 'Z')
-               return ASN1_VALUE_NOT_VALID;
-             break;
-           case 13:
-             if ((!isdigit (value[10])) || (!isdigit (value[11])) ||
-                 (value[12] != 'Z'))
-               return ASN1_VALUE_NOT_VALID;
-             break;
-           case 15:
-             if ((value[10] != '+') && (value[10] != '-'))
-               return ASN1_VALUE_NOT_VALID;
-             for (k = 11; k < 15; k++)
-               if (!isdigit (value[k]))
-                 return ASN1_VALUE_NOT_VALID;
-             break;
-           case 17:
-             if ((!isdigit (value[10])) || (!isdigit (value[11])))
+           break;
+         case 13:
+           if ((!isdigit (value[10])) || (!isdigit (value[11])) ||
+               (value[12] != 'Z'))
+             return ASN1_VALUE_NOT_VALID;
+           break;
+         case 15:
+           if ((value[10] != '+') && (value[10] != '-'))
+             return ASN1_VALUE_NOT_VALID;
+           for (k = 11; k < 15; k++)
+             if (!isdigit (value[k]))
                return ASN1_VALUE_NOT_VALID;
-             if ((value[12] != '+') && (value[12] != '-'))
+           break;
+         case 17:
+           if ((!isdigit (value[10])) || (!isdigit (value[11])))
+             return ASN1_VALUE_NOT_VALID;
+           if ((value[12] != '+') && (value[12] != '-'))
+             return ASN1_VALUE_NOT_VALID;
+           for (k = 13; k < 17; k++)
+             if (!isdigit (value[k]))
                return ASN1_VALUE_NOT_VALID;
-             for (k = 13; k < 17; k++)
-               if (!isdigit (value[k]))
-                 return ASN1_VALUE_NOT_VALID;
-             break;
-           default:
-             return ASN1_VALUE_NOT_FOUND;
-           }
-         _asn1_set_value (node, value, len);
-       }
+           break;
+         default:
+           return ASN1_VALUE_NOT_FOUND;
+         }
+       _asn1_set_value (node, value, len);
+      }
       break;
     case ASN1_ETYPE_GENERALIZED_TIME:
-      len = _asn1_strlen(value);
+      len = _asn1_strlen (value);
       _asn1_set_value (node, value, len);
       break;
     case ASN1_ETYPE_OCTET_STRING:
@@ -711,7 +710,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 int
 asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
 {
-  return asn1_read_value_type( root, name, ivalue, len, NULL);
+  return asn1_read_value_type (root, name, ivalue, len, NULL);
 }
 
 /**
@@ -777,8 +776,8 @@ asn1_read_value (asn1_node root, const char *name, void 
*ivalue, int *len)
  *   bytes needed.
  **/
 int
-asn1_read_value_type (asn1_node root, const char *name, void *ivalue, int *len,
-                      unsigned int *etype)
+asn1_read_value_type (asn1_node root, const char *name, void *ivalue,
+                     int *len, unsigned int *etype)
 {
   asn1_node node, p, p2;
   int len2, len3;
@@ -1038,12 +1037,13 @@ asn1_read_tag (asn1_node root, const char *name, int 
*tagValue,
  *
  * Returns: %ASN1_SUCCESS if the node exists.
  **/
-int asn1_read_node_value (asn1_node node, asn1_data_node_st* data)
+int
+asn1_read_node_value (asn1_node node, asn1_data_node_st * data)
 {
   data->name = node->name;
   data->value = node->value;
   data->value_len = node->value_len;
-  data->type = type_field(node->type);
-  
+  data->type = type_field (node->type);
+
   return ASN1_SUCCESS;
 }
diff --git a/lib/element.h b/lib/element.h
index 3bd38bb..014b473 100644
--- a/lib/element.h
+++ b/lib/element.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -26,8 +26,8 @@
 int _asn1_append_sequence_set (asn1_node node);
 
 int _asn1_convert_integer (const unsigned char *value,
-                                   unsigned char *value_out,
-                                   int value_out_size, int *len);
+                          unsigned char *value_out,
+                          int value_out_size, int *len);
 
 void _asn1_hierarchical_name (asn1_node node, char *name, int name_size);
 
diff --git a/lib/errors.c b/lib/errors.c
index 0a14974..99c09d0 100644
--- a/lib/errors.c
+++ b/lib/errors.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/lib/gllib/stdint.in.h b/lib/gllib/stdint.in.h
index 50170e7..07a4b80 100644
--- a/lib/gllib/stdint.in.h
+++ b/lib/gllib/stdint.in.h
@@ -39,7 +39,7 @@
    Ideally we should test __BIONIC__ here, but it is only defined after
    <sys/cdefs.h> has been included; hence test __ANDROID__ instead.  */
 #if defined __ANDROID__ \
-    && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
+    && defined _SYS_TYPES_H_ && !defined __need_size_t
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #else
 
diff --git a/lib/glm4/extensions.m4 b/lib/glm4/extensions.m4
index 617323b..07ba376 100644
--- a/lib/glm4/extensions.m4
+++ b/lib/glm4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 12  -*- Autoconf -*-
+# serial 13  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
@@ -8,7 +8,7 @@
 
 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
 # Autoconf.  Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
@@ -30,6 +30,7 @@
 # ------------------------
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
+#
 # Remember that #undef in AH_VERBATIM gets replaced with #define by
 # AC_DEFINE.  The goal here is to define all known feature-enabling
 # macros, then, if reports of conflicts are made, disable macros that
@@ -38,8 +39,6 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 
-  AC_REQUIRE([AC_CANONICAL_HOST])
-
   AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
   if test "$MINIX" = yes; then
     AC_DEFINE([_POSIX_SOURCE], [1],
@@ -50,24 +49,18 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
        except with this defined.])
     AC_DEFINE([_MINIX], [1],
       [Define to 1 if on MINIX.])
+    AC_DEFINE([_NETBSD_SOURCE], [1],
+      [Define to 1 to make NetBSD features available.  MINIX 3 needs this.])
   fi
 
-  dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
-  dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
-  dnl provided.
-  case "$host_os" in
-    hpux*)
-      AC_DEFINE([_XOPEN_SOURCE], [500],
-        [Define to 500 only on HP-UX.])
-      ;;
-  esac
-
-  AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on Mac OS X.  */
+/* Enable general extensions on OS X.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
@@ -83,6 +76,12 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
+/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
+   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
 /* Enable general extensions on Solaris.  */
 #ifndef __EXTENSIONS__
 # undef __EXTENSIONS__
@@ -103,6 +102,22 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   AC_DEFINE([_GNU_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
+  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+    [ac_cv_should_define__xopen_source],
+    [ac_cv_should_define__xopen_source=no
+     AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[
+          #include <wchar.h>
+          mbstate_t x;]])],
+       [],
+       [AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+             #define _XOPEN_SOURCE 500
+             #include <wchar.h>
+             mbstate_t x;]])],
+          [ac_cv_should_define__xopen_source=yes])])])
+  test $ac_cv_should_define__xopen_source = yes &&
+    AC_DEFINE([_XOPEN_SOURCE], [500])
 ])# AC_USE_SYSTEM_EXTENSIONS
 
 # gl_USE_SYSTEM_EXTENSIONS
diff --git a/lib/gstr.c b/lib/gstr.c
index 0558c77..34955e9 100644
--- a/lib/gstr.c
+++ b/lib/gstr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -68,6 +68,7 @@ _asn1_str_cpy (char *dest, size_t dest_tot_size, const char 
*src)
          dest[str_size] = 0;
          return str_size;
        }
-      else return 0;
+      else
+       return 0;
     }
 }
diff --git a/lib/gstr.h b/lib/gstr.h
index 672d59e..0eb8bb4 100644
--- a/lib/gstr.h
+++ b/lib/gstr.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -19,7 +19,8 @@
  * 02110-1301, USA
  */
 
-unsigned int _asn1_str_cpy (char *dest, size_t dest_tot_size, const char *src);
+unsigned int _asn1_str_cpy (char *dest, size_t dest_tot_size,
+                           const char *src);
 void _asn1_str_cat (char *dest, size_t dest_tot_size, const char *src);
 
 #define Estrcpy(x,y) _asn1_str_cpy(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y)
diff --git a/lib/int.h b/lib/int.h
index 3163d50..71848f9 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -46,7 +46,7 @@
 struct asn1_node_st
 {
   /* public fields: */
-  char name[ASN1_MAX_NAME_SIZE+1];                     /* Node name */
+  char name[ASN1_MAX_NAME_SIZE + 1];   /* Node name */
   unsigned int name_hash;
   unsigned int type;           /* Node type */
   unsigned char *value;                /* Node value */
@@ -58,10 +58,11 @@ struct asn1_node_st
   unsigned char small_value[ASN1_SMALL_VALUE_SIZE];    /* For small values */
 };
 
-typedef struct tag_and_class_st {
+typedef struct tag_and_class_st
+{
   unsigned tag;
   unsigned class;
-  const char* desc;
+  const char *desc;
 } tag_and_class_st;
 
 /* the types that are handled in _asn1_tags */
@@ -156,23 +157,25 @@ extern const tag_and_class_st _asn1_tags[];
 /* Returns the first 8 bits.            */
 /* Used with the field type of asn1_node_st */
 /****************************************/
-inline static unsigned int type_field(unsigned int ntype)
+inline static unsigned int
+type_field (unsigned int ntype)
 {
   return (ntype & 0xff);
 }
 
 /* To convert old types from a static structure */
-inline static unsigned int convert_old_type(unsigned int ntype)
+inline static unsigned int
+convert_old_type (unsigned int ntype)
 {
-unsigned int type = ntype & 0xff;
+  unsigned int type = ntype & 0xff;
   if (type == ASN1_ETYPE_TIME)
     {
       if (ntype & CONST_UTC)
-        type = ASN1_ETYPE_UTC_TIME;
+       type = ASN1_ETYPE_UTC_TIME;
       else
-        type = ASN1_ETYPE_GENERALIZED_TIME;
+       type = ASN1_ETYPE_GENERALIZED_TIME;
 
-      ntype &= ~(CONST_UTC|CONST_GENERALIZED);
+      ntype &= ~(CONST_UTC | CONST_GENERALIZED);
       ntype &= 0xffffff00;
       ntype |= type;
 
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 5cdc3ff..814b310 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -21,19 +21,19 @@
  */
 
 #ifndef LIBTASN1_H
-# define LIBTASN1_H
-
-# ifndef ASN1_API
-#  if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY
-#   define ASN1_API __attribute__((__visibility__("default")))
-#  elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC
-#   define ASN1_API __declspec(dllexport)
-#  elif defined _MSC_VER && ! defined ASN1_STATIC
-#   define ASN1_API __declspec(dllimport)
-#  else
-#   define ASN1_API
-#  endif
-# endif
+#define LIBTASN1_H
+
+#ifndef ASN1_API
+#if defined ASN1_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY
+#define ASN1_API __attribute__((__visibility__("default")))
+#elif defined ASN1_BUILDING && defined _MSC_VER && ! defined ASN1_STATIC
+#define ASN1_API __declspec(dllexport)
+#elif defined _MSC_VER && ! defined ASN1_STATIC
+#define ASN1_API __declspec(dllimport)
+#else
+#define ASN1_API
+#endif
+#endif
 
 #include <sys/types.h>
 #include <time.h>
@@ -44,7 +44,7 @@ extern "C"
 {
 #endif
 
-#define ASN1_VERSION "3.2"
+#define ASN1_VERSION "3.3"
 
   /*****************************************/
   /* Errors returned by libtasn1 functions */
@@ -172,7 +172,7 @@ extern "C"
   {
     const char *name;          /* Node name */
     const void *value;         /* Node value */
-    unsigned int value_len;     /* Node value size */
+    unsigned int value_len;    /* Node value size */
     unsigned int type;         /* Node value type (ASN1_ETYPE_*) */
   };
   typedef struct asn1_data_node_st asn1_data_node_st;
@@ -227,10 +227,10 @@ extern "C"
 
   extern ASN1_API int
     asn1_read_value_type (asn1_node root, const char *name,
-                         void *ivalue, int *len, unsigned int* etype);
+                         void *ivalue, int *len, unsigned int *etype);
 
   extern ASN1_API int
-    asn1_read_node_value (asn1_node node, asn1_data_node_st* data);
+    asn1_read_node_value (asn1_node node, asn1_data_node_st * data);
 
   extern ASN1_API int
     asn1_number_of_elements (asn1_node element, const char *name, int *num);
@@ -293,12 +293,15 @@ extern "C"
   /* Other utility functions. */
 
   extern ASN1_API
-    int asn1_decode_simple_der (unsigned int etype, const unsigned char *der, 
unsigned int der_len,
-                        const unsigned char **str, unsigned int *str_len);
+    int asn1_decode_simple_der (unsigned int etype, const unsigned char *der,
+                               unsigned int der_len,
+                               const unsigned char **str,
+                               unsigned int *str_len);
 
   extern ASN1_API int
-    asn1_encode_simple_der (unsigned int etype, const unsigned char *str, 
unsigned int str_len,
-                        unsigned char *tl, unsigned int *tl_len);
+    asn1_encode_simple_der (unsigned int etype, const unsigned char *str,
+                           unsigned int str_len, unsigned char *tl,
+                           unsigned int *tl_len);
 
   extern ASN1_API asn1_node
     asn1_find_node (asn1_node pointer, const char *name);
@@ -332,7 +335,7 @@ extern "C"
 
 /* Compatibility types */
 
-typedef int asn1_retCode;      /* type returned by libtasn1 functions */
+  typedef int asn1_retCode;    /* type returned by libtasn1 functions */
 
 #define node_asn_struct asn1_node_st
 #define node_asn asn1_node_st
diff --git a/lib/libtasn1.map b/lib/libtasn1.map
index 2edf9ef..4ddfd42 100644
--- a/lib/libtasn1.map
+++ b/lib/libtasn1.map
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
@@ -57,4 +57,3 @@ LIBTASN1_0_3
   local:
     *;
 };
-
diff --git a/lib/libtasn1.pc.in b/lib/libtasn1.pc.in
index 32da237..429c58a 100644
--- a/lib/libtasn1.pc.in
+++ b/lib/libtasn1.pc.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2012 Free Software Foundation, Inc.
+# Copyright (C) 2005-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 50238d2..34bf1e7 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -119,12 +119,12 @@ asn1_find_node (asn1_node pointer, const char *name)
          n_start = n_end;
          n_start++;
 
-          nhash = hash_pjw_bare(n, nsize);
+         nhash = hash_pjw_bare (n, nsize);
        }
       else
        {
          nsize = _asn1_str_cpy (n, sizeof (n), n_start);
-          nhash = hash_pjw_bare(n, nsize);
+         nhash = hash_pjw_bare (n, nsize);
 
          n_start = NULL;
        }
@@ -157,12 +157,12 @@ asn1_find_node (asn1_node pointer, const char *name)
          n_start = n_end;
          n_start++;
 
-          nhash = hash_pjw_bare(n, nsize);
+         nhash = hash_pjw_bare (n, nsize);
        }
       else
        {
          nsize = _asn1_str_cpy (n, sizeof (n), n_start);
-          nhash = hash_pjw_bare(n, nsize);
+         nhash = hash_pjw_bare (n, nsize);
          n_start = NULL;
        }
 
@@ -358,7 +358,7 @@ _asn1_append_value (asn1_node node, const void *value, 
unsigned int len)
 asn1_node
 _asn1_set_name (asn1_node node, const char *name)
 {
-unsigned int nsize;
+  unsigned int nsize;
 
   if (node == NULL)
     return node;
@@ -366,12 +366,12 @@ unsigned int nsize;
   if (name == NULL)
     {
       node->name[0] = 0;
-      node->name_hash = hash_pjw_bare(node->name, 0);
+      node->name_hash = hash_pjw_bare (node->name, 0);
       return node;
     }
 
   nsize = _asn1_str_cpy (node->name, sizeof (node->name), name);
-  node->name_hash = hash_pjw_bare(node->name, nsize);
+  node->name_hash = hash_pjw_bare (node->name, nsize);
 
   return node;
 }
@@ -393,7 +393,7 @@ _asn1_cpy_name (asn1_node dst, asn1_node src)
   if (src == NULL)
     {
       dst->name[0] = 0;
-      dst->name_hash = hash_pjw_bare(dst->name, 0);
+      dst->name_hash = hash_pjw_bare (dst->name, 0);
       return dst;
     }
 
@@ -581,7 +581,8 @@ _asn1_change_integer_value (asn1_node node)
   p = node;
   while (p)
     {
-      if ((type_field (p->type) == ASN1_ETYPE_INTEGER) && (p->type & 
CONST_ASSIGN))
+      if ((type_field (p->type) == ASN1_ETYPE_INTEGER)
+         && (p->type & CONST_ASSIGN))
        {
          if (p->value)
            {
@@ -666,8 +667,9 @@ _asn1_expand_object_id (asn1_node node)
                      _asn1_str_cat (name2, sizeof (name2),
                                     (char *) p2->value);
                      p3 = asn1_find_node (node, name2);
-                     if (!p3 || (type_field (p3->type) != 
ASN1_ETYPE_OBJECT_ID) ||
-                         !(p3->type & CONST_ASSIGN))
+                     if (!p3
+                         || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID)
+                         || !(p3->type & CONST_ASSIGN))
                        return ASN1_ELEMENT_NOT_FOUND;
                      _asn1_set_down (p, p2->right);
                      _asn1_remove_node (p2);
@@ -677,7 +679,8 @@ _asn1_expand_object_id (asn1_node node)
                        {
                          if (type_field (p4->type) == ASN1_ETYPE_CONSTANT)
                            {
-                             p5 = _asn1_add_single_node (ASN1_ETYPE_CONSTANT);
+                             p5 =
+                               _asn1_add_single_node (ASN1_ETYPE_CONSTANT);
                              _asn1_set_name (p5, p4->name);
                              tlen = _asn1_strlen (p4->value);
                              if (tlen > 0)
@@ -752,8 +755,8 @@ _asn1_expand_object_id (asn1_node node)
                  _asn1_str_cat (name2, sizeof (name2), ".");
                  _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
                  p3 = asn1_find_node (node, name2);
-                 if (!p3 || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) ||
-                     !(p3->type & CONST_ASSIGN))
+                 if (!p3 || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID)
+                     || !(p3->type & CONST_ASSIGN))
                    return ASN1_ELEMENT_NOT_FOUND;
                  p4 = p3->down;
                  name2[0] = 0;
@@ -911,9 +914,9 @@ _asn1_check_identifier (asn1_node node)
          if (p2 == NULL)
            {
              if (p->value)
-               _asn1_strcpy (_asn1_identifierMissing, p->value);
-              else
-               _asn1_strcpy (_asn1_identifierMissing, "(null)");
+               _asn1_strcpy (_asn1_identifierMissing, p->value);
+             else
+               _asn1_strcpy (_asn1_identifierMissing, "(null)");
              return ASN1_IDENTIFIER_NOT_FOUND;
            }
        }
@@ -948,8 +951,8 @@ _asn1_check_identifier (asn1_node node)
                  _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
                  _asn1_strcpy (_asn1_identifierMissing, p2->value);
                  p2 = asn1_find_node (node, name2);
-                 if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) ||
-                     !(p2->type & CONST_ASSIGN))
+                 if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID)
+                     || !(p2->type & CONST_ASSIGN))
                    return ASN1_IDENTIFIER_NOT_FOUND;
                  else
                    _asn1_identifierMissing[0] = 0;
diff --git a/lib/parser_aux.h b/lib/parser_aux.h
index f270b73..24663eb 100644
--- a/lib/parser_aux.h
+++ b/lib/parser_aux.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/lib/structure.c b/lib/structure.c
index 31a5f65..22f1037 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -192,7 +192,7 @@ asn1_array2tree (const asn1_static_node * array, asn1_node 
* definitions,
   k = 0;
   while (array[k].value || array[k].type || array[k].name)
     {
-      type = convert_old_type(array[k].type);
+      type = convert_old_type (array[k].type);
 
       p = _asn1_add_static_node (type & (~CONST_DOWN));
       if (array[k].name)
@@ -409,22 +409,22 @@ _asn1_copy_structure3 (asn1_node source_node)
        }
 
       if (p_s == source_node)
-        break;
+       break;
 
       if (p_s->right)
-        {
-           move = RIGHT;
-           p_s = p_s->right;
-           p_d_prev = p_d;
-           p_d = _asn1_add_single_node (p_s->type);
-           _asn1_set_right (p_d_prev, p_d);
-        }
+       {
+         move = RIGHT;
+         p_s = p_s->right;
+         p_d_prev = p_d;
+         p_d = _asn1_add_single_node (p_s->type);
+         _asn1_set_right (p_d_prev, p_d);
+       }
       else
-        {
-           move = UP;
-           p_s = _asn1_find_up (p_s);
-           p_d = _asn1_find_up (p_d);
-        }
+       {
+         move = UP;
+         p_s = _asn1_find_up (p_s);
+         p_d = _asn1_find_up (p_d);
+       }
     }
   while (p_s != source_node);
 
@@ -460,7 +460,8 @@ _asn1_type_choice_config (asn1_node node)
     {
       if (move != UP)
        {
-         if ((type_field (p->type) == ASN1_ETYPE_CHOICE) && (p->type & 
CONST_TAG))
+         if ((type_field (p->type) == ASN1_ETYPE_CHOICE)
+             && (p->type & CONST_TAG))
            {
              p2 = p->down;
              while (p2)
@@ -548,7 +549,7 @@ _asn1_expand_identifier (asn1_node * node, asn1_node root)
        {
          if (type_field (p->type) == ASN1_ETYPE_IDENTIFIER)
            {
-             snprintf(name2, sizeof (name2), "%s.%s", root->name, p->value);
+             snprintf (name2, sizeof (name2), "%s.%s", root->name, p->value);
              p2 = _asn1_copy_structure2 (root, name2);
              if (p2 == NULL)
                {
@@ -765,7 +766,7 @@ asn1_print_structure (FILE * out, asn1_node structure, 
const char *name,
            case ASN1_ETYPE_DEFINITIONS:
              fprintf (out, "type:DEFINITIONS");
              break;
-            CASE_HANDLED_ETYPES:
+           CASE_HANDLED_ETYPES:
              fprintf (out, "%s", _asn1_tags[type].desc);
              break;
            default:
@@ -854,7 +855,7 @@ asn1_print_structure (FILE * out, asn1_node structure, 
const char *name,
              if (p->value)
                {
                  fprintf (out, "  value:");
-                  for (k = 0; k < p->value_len; k++)
+                 for (k = 0; k < p->value_len; k++)
                    fprintf (out, "%c", (p->value)[k]);
                }
              break;
diff --git a/lib/structure.h b/lib/structure.h
index 986e13a..0e1e79d 100644
--- a/lib/structure.h
+++ b/lib/structure.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -29,8 +29,7 @@
 #define _STRUCTURE_H
 
 int _asn1_create_static_structure (asn1_node pointer,
-                                           char *output_file_name,
-                                           char *vector_name);
+                                  char *output_file_name, char *vector_name);
 
 asn1_node _asn1_copy_structure3 (asn1_node source_node);
 
diff --git a/lib/version.c b/lib/version.c
index 83d70c9..3725236 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2000-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/m4/update-header-version.m4 b/m4/update-header-version.m4
index d4a3e84..a13a70b 100644
--- a/m4/update-header-version.m4
+++ b/m4/update-header-version.m4
@@ -1,5 +1,5 @@
 # update-header-version.m4 serial 1
-dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/maint.mk b/maint.mk
index 4627bc5..2b454a1 100644
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
 # This Makefile fragment tries to be general-purpose enough to be
 # used by many projects via the gnulib maintainer-makefile module.
 
-## Copyright (C) 2001-2012 Free Software Foundation, Inc.
+## Copyright (C) 2001-2013 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
@@ -28,6 +28,28 @@ ifneq ($(build_aux),)
 set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)")
 endif
 
+# Helper variables.
+_empty =
+_sp = $(_empty) $(_empty)
+
+# _equal,S1,S2
+# ------------
+# If S1 == S2, return S1, otherwise the empty string.
+_equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
+
+# member-check,VARIABLE,VALID-VALUES
+# ----------------------------------
+# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and
+# return it.  Die otherwise.
+member-check =                                                         \
+  $(strip                                                              \
+    $(if $($(1)),                                                      \
+      $(if $(findstring $(_sp),$($(1))),                               \
+          $(error invalid $(1): '$($(1))', expected $(2)),             \
+          $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)),     \
+            $(error invalid $(1): '$($(1))', expected $(2)))),         \
+      $(error $(1) undefined)))
+
 # Do not save the original name or timestamp in the .tar.gz file.
 # Use --rsyncable if available.
 gzip_rsyncable := \
@@ -52,9 +74,9 @@ _dot_escaped_srcdir = $(subst .,\.,$(srcdir))
 # Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
 # when $(srcdir) is not ".".
 ifeq ($(srcdir),.)
-_prepend_srcdir_prefix =
+  _prepend_srcdir_prefix =
 else
-_prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|'
+  _prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|'
 endif
 
 # In order to be able to consistently filter "."-relative names,
@@ -78,32 +100,41 @@ VERSION_REGEXP = $(subst .,\.,$(VERSION))
 PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
 
 ifeq ($(VC),$(GIT))
-this-vc-tag = v$(VERSION)
-this-vc-tag-regexp = v$(VERSION_REGEXP)
+  this-vc-tag = v$(VERSION)
+  this-vc-tag-regexp = v$(VERSION_REGEXP)
 else
-tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
-tag-this-version = $(subst .,_,$(VERSION))
-this-vc-tag = $(tag-package)-$(tag-this-version)
-this-vc-tag-regexp = $(this-vc-tag)
+  tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
+  tag-this-version = $(subst .,_,$(VERSION))
+  this-vc-tag = $(tag-package)-$(tag-this-version)
+  this-vc-tag-regexp = $(this-vc-tag)
 endif
 my_distdir = $(PACKAGE)-$(VERSION)
 
 # Old releases are stored here.
 release_archive_dir ?= ../release
 
+# If RELEASE_TYPE is undefined, but RELEASE is, use its second word.
+# But overwrite VERSION.
+ifdef RELEASE
+  VERSION := $(word 1, $(RELEASE))
+  RELEASE_TYPE ?= $(word 2, $(RELEASE))
+endif
+
+# Validate and return $(RELEASE_TYPE), or die.
+RELEASE_TYPES = alpha beta stable
+release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES))
+
 # Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
 # Use alpha.gnu.org for alpha and beta releases.
 # Use ftp.gnu.org for stable releases.
 gnu_ftp_host-alpha = alpha.gnu.org
 gnu_ftp_host-beta = alpha.gnu.org
 gnu_ftp_host-stable = ftp.gnu.org
-gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE))
+gnu_rel_host ?= $(gnu_ftp_host-$(release-type))
 
-ifeq ($(gnu_rel_host),ftp.gnu.org)
-url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE)
-else
-url_dir_list ?= ftp://$(gnu_rel_host)/gnu/$(PACKAGE)
-endif
+url_dir_list ?= $(if $(call _equal,$(gnu_rel_host),ftp.gnu.org),       \
+                     http://ftpmirror.gnu.org/$(PACKAGE),              \
+                     ftp://$(gnu_rel_host)/gnu/$(PACKAGE))
 
 # Override this in cfg.mk if you are using a different format in your
 # NEWS file.
@@ -124,7 +155,7 @@ export LC_ALL = C
 ## Sanity checks.  ##
 ## --------------- ##
 
-_cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk')
+_cfg_mk := $(wildcard $(srcdir)/cfg.mk)
 
 # Collect the names of rules starting with 'sc_'.
 syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' 
\
@@ -132,9 +163,9 @@ syntax-check-rules := $(sort $(shell sed -n 
's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
 .PHONY: $(syntax-check-rules)
 
 ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
-local-checks-available += $(syntax-check-rules)
+  local-checks-available += $(syntax-check-rules)
 else
-local-checks-available += no-vc-detected
+  local-checks-available += no-vc-detected
 no-vc-detected:
        @echo "No version control files detected; skipping syntax check"
 endif
@@ -330,7 +361,7 @@ sc_prohibit_atoi_atof:
 sp_ = strcmp *\(.+\)
 sc_prohibit_strcmp:
        @prohibit='! *strcmp *\(|\<$(sp_) *[!=]=|[!=]= *$(sp_)'         \
-       exclude=':# *define STRN?EQ\('                                  \
+       exclude='# *define STRN?EQ\('                                   \
        halt='replace strcmp calls above with STREQ/STRNEQ'             \
          $(_sc_search_regexp)
 
@@ -354,7 +385,7 @@ sc_prohibit_strncpy:
 #      perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
 sc_prohibit_magic_number_exit:
        @prohibit='(^|[^.])\<(usage|exit|error) ?\(-?[0-9]+[,)]'        \
-       exclude='error ?\((0,|[^,]*)'                                   \
+       exclude='exit \(77\)|error ?\(((0|77),|[^,]*)'                  \
        halt='use EXIT_* values rather than magic number'               \
          $(_sc_search_regexp)
 
@@ -570,8 +601,6 @@ sc_prohibit_c_ctype_without_use:
        @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \
          $(_sc_header_without_use)
 
-_empty =
-_sp = $(_empty) $(_empty)
 # The following list was generated by running:
 # man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \
 #   | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt
@@ -724,6 +753,7 @@ sc_require_test_exit_idiom:
 sc_trailing_blank:
        @prohibit='[     ]$$'                                           \
        halt='found trailing blank(s)'                                  \
+       exclude='^Binary file .* matches$$'                             \
          $(_sc_search_regexp)
 
 # Match lines like the following, but where there is only one space
@@ -1091,9 +1121,11 @@ fix_po_file_diag = \
 'you have changed the set of files with translatable diagnostics;\n\
 apply the above patch\n'
 
-# Verify that all source files using _() are listed in po/POTFILES.in.
+# Verify that all source files using _() (more specifically, files that
+# match $(_gl_translatable_string_re)) are listed in po/POTFILES.in.
 po_file ?= $(srcdir)/po/POTFILES.in
 generated_files ?= $(srcdir)/lib/*.[ch]
+_gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
 sc_po_check:
        @if test -f $(po_file); then                                    \
          grep -E -v '^(#|$$)' $(po_file)                               \
@@ -1113,7 +1145,7 @@ sc_po_check:
            esac;                                                       \
            files="$$files $$file";                                     \
          done;                                                         \
-         grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files          \
+         grep -E -l '$(_gl_translatable_string_re)' $$files            \
            | sed 's|^$(_dot_escaped_srcdir)/||' | sort -u > address@hidden;    
\
          diff -u -L $(po_file) -L $(po_file) address@hidden address@hidden     
                \
            || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; };   \
@@ -1134,7 +1166,7 @@ sc_makefile_path_separator_check:
 # i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release)
 # and is read-only.
 writable-files:
-       if test -d $(release_archive_dir); then                         \
+       $(AM_V_GEN)if test -d $(release_archive_dir); then              \
          for file in $(DIST_ARCHIVES); do                              \
            for p in ./ $(release_archive_dir)/; do                     \
              test -e $$p$$file || continue;                            \
@@ -1216,7 +1248,7 @@ sc_Wundef_boolean:
 # not be constant, or might overflow a stack.  In general, use PATH_MAX as
 # a limit, not an array or alloca size.
 sc_prohibit_path_max_allocation:
-       @prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX'                 \
+       @prohibit='(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX'               \
        halt='Avoid stack allocations of size PATH_MAX'                 \
          $(_sc_search_regexp)
 
@@ -1265,23 +1297,28 @@ gpg_key_ID ?=                                           
                \
 translation_project_ ?= address@hidden
 
 # Make info-gnu the default only for a stable release.
-ifeq ($(RELEASE_TYPE),stable)
-  announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
-  announcement_mail_headers_ ?=                                                
\
-    To: address@hidden                                         \
-    Cc: $(announcement_Cc_)                                            \
-    Mail-Followup-To: $(PACKAGE_BUGREPORT)
-else
-  announcement_Cc_ ?= $(translation_project_)
-  announcement_mail_headers_ ?=                                                
\
-    To: $(PACKAGE_BUGREPORT)                                           \
-    Cc: $(announcement_Cc_)
-endif
-
+announcement_Cc_stable = $(translation_project_), $(PACKAGE_BUGREPORT)
+announcement_mail_headers_stable =             \
+  To: address@hidden                           \
+  Cc: $(announcement_Cc_)                      \
+  Mail-Followup-To: $(PACKAGE_BUGREPORT)
+
+announcement_Cc_alpha = $(translation_project_)
+announcement_mail_headers_alpha =              \
+  To: $(PACKAGE_BUGREPORT)                     \
+  Cc: $(announcement_Cc_)
+
+announcement_mail_Cc_beta = $(announcement_mail_Cc_alpha)
+announcement_mail_headers_beta = $(announcement_mail_headers_alpha)
+
+announcement_mail_Cc_ ?= $(announcement_mail_Cc_$(release-type))
+announcement_mail_headers_ ?= $(announcement_mail_headers_$(release-type))
 announcement: NEWS ChangeLog $(rel-files)
-       $(AM_V_GEN)$(srcdir)/$(_build-aux)/announce-gen                 \
+# Not $(AM_V_GEN) since the output of this command serves as
+# announcement message: it would start with " GEN announcement".
+       $(AM_V_at)$(srcdir)/$(_build-aux)/announce-gen                  \
            --mail-headers='$(announcement_mail_headers_)'              \
-           --release-type=$(RELEASE_TYPE)                              \
+           --release-type=$(release-type)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
            --curr=$(VERSION)                                           \
@@ -1308,16 +1345,22 @@ ftp-gnu = ftp://ftp.gnu.org/gnu
 www-gnu = http://www.gnu.org
 
 upload_dest_dir_ ?= $(PACKAGE)
+upload_command =                                               \
+  $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS)            \
+  --to $(gnu_rel_host):$(upload_dest_dir_)                     \
+  $(rel-files)
 emit_upload_commands:
        @echo =====================================
        @echo =====================================
-       @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\"
-       @echo "    --to $(gnu_rel_host):$(upload_dest_dir_) \\"
-       @echo "  $(rel-files)"
+       @echo '$(upload_command)'
        @echo '# send the ~/announce-$(my_distdir) e-mail'
        @echo =====================================
        @echo =====================================
 
+.PHONY: upload
+upload:
+       $(AM_V_GEN)$(upload_command)
+
 define emit-commit-log
   printf '%s\n' 'maint: post-release administrivia' ''                 \
     '* NEWS: Add header line for next release.'                                
\
@@ -1327,7 +1370,8 @@ endef
 
 .PHONY: no-submodule-changes
 no-submodule-changes:
-       $(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
+       $(AM_V_GEN)if test -d $(srcdir)/.git                            \
+               && git --version >/dev/null 2>&1; then                  \
          diff=$$(cd $(srcdir) && git submodule -q foreach              \
                  git diff-index --name-only HEAD)                      \
            || exit 1;                                                  \
@@ -1345,10 +1389,12 @@ submodule-checks ?= no-submodule-changes 
public-submodule-commit
 # cannot be built from a fresh clone.
 .PHONY: public-submodule-commit
 public-submodule-commit:
-       $(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
+       $(AM_V_GEN)if test -d $(srcdir)/.git                            \
+               && git --version >/dev/null 2>&1; then                  \
          cd $(srcdir) &&                                               \
-         git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \
-             = '$$(git merge-base origin $$sha1)'                      \
+         git submodule --quiet foreach                                 \
+             test '"$$(git rev-parse "$$sha1")"'                       \
+             = '"$$(git merge-base origin "$$sha1")"'                  \
            || { echo '$(ME): found non-public submodule commit' >&2;   \
                 exit 1; };                                             \
        else                                                            \
@@ -1363,7 +1409,7 @@ public-submodule-commit:
 gl_public_submodule_commit ?= public-submodule-commit
 check: $(gl_public_submodule_commit)
 
-.PHONY: alpha beta stable
+.PHONY: alpha beta stable release
 ALL_RECURSIVE_TARGETS += alpha beta stable
 alpha beta stable: $(local-check) writable-files $(submodule-checks)
        $(AM_V_GEN)test $@ = stable                                     \
@@ -1377,15 +1423,16 @@ alpha beta stable: $(local-check) writable-files 
$(submodule-checks)
        $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
        $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
 
+release:
+       $(AM_V_GEN)$(MAKE) $(release-type)
+
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep
 
 gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
 .PHONY: release-prep
 release-prep:
-       $(AM_V_GEN)case $$RELEASE_TYPE in alpha|beta|stable) ;; \
-         *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
-       $(AM_V_at)$(MAKE) --no-print-directory -s announcement \
+       $(AM_V_GEN)$(MAKE) --no-print-directory -s announcement \
          > ~/announce-$(my_distdir)
        $(AM_V_at)if test -d $(release_archive_dir); then       \
          ln $(rel-files) $(release_archive_dir);               \
@@ -1575,6 +1622,7 @@ _gl_TS_obj_files ?= *.$(OBJEXT)
 # Files in which to search for the one-line style extern declarations.
 # $(_gl_TS_dir)-relative.
 _gl_TS_headers ?= $(noinst_HEADERS)
+_gl_TS_other_headers ?= *.h
 
 .PHONY: _gl_tight_scope
 _gl_tight_scope: $(bin_PROGRAMS)
@@ -1597,7 +1645,8 @@ _gl_tight_scope: $(bin_PROGRAMS)
          && { echo the above functions should have static scope >&2;   \
               exit 1; } || : ;                                         \
        ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars);       \
-         perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' $$hdr *.h \
+         perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"'           \
+               $$hdr $(_gl_TS_other_headers)                           \
        ) | sort -u > $$t;                                              \
        nm -e $(_gl_TS_obj_files) | sed -n 's/.* [BCDGRS] //p'          \
             | sort -u | grep -Ev -f $$t                                        
\
diff --git a/src/Makefile.am b/src/Makefile.am
index b0ed06e..8bf2802 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 700e958..e8f9959 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -1,5 +1,5 @@
 /* asn1Coding.c --- program to generate a DER coding of an ASN1 definition.
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -214,8 +214,7 @@ main (int argc, char *argv[])
       fputs ("Parse: done.\n", stderr);
       break;
     case ASN1_FILE_NOT_FOUND:
-      fprintf (stderr, "asn1Coding: FILE %s NOT FOUND\n",
-               inputFileAsnName);
+      fprintf (stderr, "asn1Coding: FILE %s NOT FOUND\n", inputFileAsnName);
       break;
     case ASN1_SYNTAX_ERROR:
     case ASN1_IDENTIFIER_NOT_FOUND:
@@ -223,8 +222,7 @@ main (int argc, char *argv[])
       fprintf (stderr, "asn1Coding: %s\n", errorDescription);
       break;
     default:
-      fprintf (stderr, "libtasn1 ERROR: %s\n",
-               asn1_strerror (asn1_result));
+      fprintf (stderr, "libtasn1 ERROR: %s\n", asn1_strerror (asn1_result));
     }
 
   if (asn1_result != ASN1_SUCCESS)
@@ -240,7 +238,7 @@ main (int argc, char *argv[])
   if (inputFile == NULL)
     {
       fprintf (stderr, "asn1Coding: file '%s' not found\n",
-               inputFileAssignmentName);
+              inputFileAssignmentName);
       free (inputFileAsnName);
       free (inputFileAssignmentName);
       exit (1);
@@ -250,7 +248,7 @@ main (int argc, char *argv[])
   putc ('\n', stderr);
 
   while ((last_ra = readAssignment (inputFile, varName, value))
-          == ASSIGNMENT_SUCCESS)
+        == ASSIGNMENT_SUCCESS)
     {
       fprintf (stderr, "var=%s, value=%s\n", varName, value);
       if (structure == NULL)
@@ -263,7 +261,7 @@ main (int argc, char *argv[])
       if (asn1_result != ASN1_SUCCESS)
        {
          fprintf (stderr, "libtasn1 ERROR: %s\n",
-                  asn1_strerror (asn1_result));
+                  asn1_strerror (asn1_result));
 
          asn1_delete_structure (&definitions);
          asn1_delete_structure (&structure);
@@ -331,8 +329,8 @@ main (int argc, char *argv[])
       if (outputFile == NULL)
        {
          fprintf (stderr,
-                  "asn1Coding: output file '%s' not available\n",
-                  outputFileName);
+                  "asn1Coding: output file '%s' not available\n",
+                  outputFileName);
          free (der);
          free (inputFileAsnName);
          free (inputFileAssignmentName);
diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c
index 00156c5..5861604 100644
--- a/src/asn1Decoding.c
+++ b/src/asn1Decoding.c
@@ -1,5 +1,5 @@
 /* asn1Decoding.c ---  program to generate an ASN1 type from a DER coding.
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -33,7 +33,8 @@
 #include <read-file.h>
 #include "benchmark.h"
 
-static int decode(asn1_node definitions, const char* typeName, void* der, int 
der_len, int benchmark);
+static int decode (asn1_node definitions, const char *typeName, void *der,
+                  int der_len, int benchmark);
 
 /* This feature is available in gcc versions 2.5 and later.  */
 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
@@ -101,9 +102,9 @@ main (int argc, char *argv[])
        case 'h':               /* HELP */
          usage (EXIT_SUCCESS);
          break;
-        case 'b':
-          benchmark = 1;
-          break;
+       case 'b':
+         benchmark = 1;
+         break;
        case 'v':               /* VERSION */
          version_etc (stdout, program_name, PACKAGE, VERSION,
                       "Fabio Fiorina", NULL);
@@ -147,8 +148,7 @@ main (int argc, char *argv[])
       fprintf (stderr, "Parse: done.\n");
       break;
     case ASN1_FILE_NOT_FOUND:
-      fprintf (stderr, "asn1Decoding: FILE %s NOT FOUND\n",
-               inputFileAsnName);
+      fprintf (stderr, "asn1Decoding: FILE %s NOT FOUND\n", inputFileAsnName);
       break;
     case ASN1_SYNTAX_ERROR:
     case ASN1_IDENTIFIER_NOT_FOUND:
@@ -156,8 +156,7 @@ main (int argc, char *argv[])
       fprintf (stderr, "asn1Decoding: %s\n", errorDescription);
       break;
     default:
-      fprintf (stderr, "libtasn1 ERROR: %s\n",
-               asn1_strerror (asn1_result));
+      fprintf (stderr, "libtasn1 ERROR: %s\n", asn1_strerror (asn1_result));
     }
 
   if (asn1_result != ASN1_SUCCESS)
@@ -178,7 +177,7 @@ main (int argc, char *argv[])
   if (der == NULL)
     {
       fprintf (stderr, "asn1Decoding: could not read '%s'\n",
-               inputFileDerName);
+              inputFileDerName);
       asn1_delete_structure (&definitions);
 
       free (inputFileAsnName);
@@ -203,7 +202,7 @@ main (int argc, char *argv[])
      fclose(inputFile);
    */
 
-  if (decode( definitions, typeName, der, der_len, benchmark) != ASN1_SUCCESS)
+  if (decode (definitions, typeName, der, der_len, benchmark) != ASN1_SUCCESS)
     {
       asn1_delete_structure (&definitions);
       free (inputFileAsnName);
@@ -212,7 +211,7 @@ main (int argc, char *argv[])
       free (der);
       exit (1);
     }
-  
+
   asn1_delete_structure (&definitions);
 
   free (der);
@@ -227,12 +226,14 @@ main (int argc, char *argv[])
   exit (0);
 }
 
-static int simple_decode(asn1_node definitions, const char* typeName, void* 
der, int der_len, int benchmark)
+static int
+simple_decode (asn1_node definitions, const char *typeName, void *der,
+              int der_len, int benchmark)
 {
-  
-int asn1_result;
-asn1_node structure = NULL;
-char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
+
+  int asn1_result;
+  asn1_node structure = NULL;
+  char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
 
   asn1_result = asn1_create_element (definitions, typeName, &structure);
 
@@ -242,7 +243,7 @@ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
   if (asn1_result != ASN1_SUCCESS)
     {
       fprintf (stderr, "Structure creation: %s\n",
-               asn1_strerror (asn1_result));
+              asn1_strerror (asn1_result));
       asn1_delete_structure (&structure);
       return asn1_result;
     }
@@ -262,31 +263,35 @@ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
   if (!benchmark)
     {
       fprintf (stderr, "\nDECODING RESULT:\n");
-      asn1_print_structure (stdout, structure, "", ASN1_PRINT_NAME_TYPE_VALUE);
+      asn1_print_structure (stdout, structure, "",
+                           ASN1_PRINT_NAME_TYPE_VALUE);
     }
   asn1_delete_structure (&structure);
   return ASN1_SUCCESS;
 }
 
-static int decode(asn1_node definitions, const char* typeName, void* der, int 
der_len, int benchmark)
+static int
+decode (asn1_node definitions, const char *typeName, void *der, int der_len,
+       int benchmark)
 {
-struct benchmark_st st;
+  struct benchmark_st st;
 
-  if (benchmark == 0) return simple_decode(definitions, typeName, der, 
der_len, benchmark);
+  if (benchmark == 0)
+    return simple_decode (definitions, typeName, der, der_len, benchmark);
   else
     {
-      start_benchmark(&st);
-      
+      start_benchmark (&st);
+
       do
-        {
-          simple_decode(definitions, typeName, der, der_len, benchmark);
-          st.size++;
-        }
-      while(benchmark_must_finish == 0);
-      
-      stop_benchmark(&st, "structures");
-      fprintf(stdout, "\n");
-    
+       {
+         simple_decode (definitions, typeName, der, der_len, benchmark);
+         st.size++;
+       }
+      while (benchmark_must_finish == 0);
+
+      stop_benchmark (&st, "structures");
+      fprintf (stdout, "\n");
+
     }
   return ASN1_SUCCESS;
 }
diff --git a/src/asn1Parser.c b/src/asn1Parser.c
index 64bf16b..239356b 100644
--- a/src/asn1Parser.c
+++ b/src/asn1Parser.c
@@ -1,5 +1,5 @@
 /* asn1Parser.c -- program to parse a file with ASN1 definitions
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -100,8 +100,7 @@ main (int argc, char *argv[])
       switch (option_result)
        {
        case 0:
-         fprintf (stderr, "option %s",
-                  long_options[option_index].name);
+         fprintf (stderr, "option %s", long_options[option_index].name);
          if (optarg)
            fprintf (stderr, " with arg %s", optarg);
          putc ('\n', stderr);
@@ -174,8 +173,7 @@ main (int argc, char *argv[])
       fputs ("Done.\n", stderr);
       break;
     case ASN1_FILE_NOT_FOUND:
-      fprintf (stderr, "asn1Parser: file %s was not found\n",
-               inputFileName);
+      fprintf (stderr, "asn1Parser: file %s was not found\n", inputFileName);
       break;
     case ASN1_SYNTAX_ERROR:
     case ASN1_IDENTIFIER_NOT_FOUND:
@@ -183,8 +181,7 @@ main (int argc, char *argv[])
       fprintf (stderr, "asn1Parser: %s\n", errorDescription);
       break;
     default:
-      fprintf (stderr, "libtasn1 ERROR: %s\n",
-               asn1_strerror (parse_result));
+      fprintf (stderr, "libtasn1 ERROR: %s\n", asn1_strerror (parse_result));
     }
 
 
diff --git a/src/benchmark.c b/src/benchmark.c
index 1ebf6b6..dcde7c0 100644
--- a/src/benchmark.c
+++ b/src/benchmark.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2011-2013 Free Software Foundation, Inc.
  *
  * This file is part of GnuTLS.
  *
@@ -28,7 +28,7 @@
 
 int benchmark_must_finish = 0;
 
-#if defined(_WIN32)
+#if defined _WIN32
 #include <windows.h>
 DWORD WINAPI
 alarm_handler (LPVOID lpParameter)
@@ -48,7 +48,7 @@ alarm_handler (int signo)
 
 static void
 value2human (unsigned long bytes, double secs, double *data, double *speed,
-             char *metric)
+            char *metric)
 {
   if (bytes > 1000 && bytes < 1000 * 1000)
     {
@@ -80,42 +80,45 @@ value2human (unsigned long bytes, double secs, double 
*data, double *speed,
     }
 }
 
-void start_benchmark(struct benchmark_st * st)
+void
+start_benchmark (struct benchmark_st *st)
 {
-  memset(st, 0, sizeof(*st));
+  memset (st, 0, sizeof (*st));
 #ifndef _WIN32
   st->old_handler = signal (SIGALRM, alarm_handler);
 #endif
   gettime (&st->start);
   benchmark_must_finish = 0;
 
-#if defined(_WIN32)
+#if defined _WIN32
   st->wtimer = CreateWaitableTimer (NULL, TRUE, NULL);
   if (st->wtimer == NULL)
     {
       fprintf (stderr, "error: CreateWaitableTimer %u\n", GetLastError ());
-      exit(1);
+      exit (1);
     }
   st->wthread = CreateThread (NULL, 0, alarm_handler, &st->wtimer, 0, NULL);
   if (st->wthread == NULL)
     {
       fprintf (stderr, "error: CreateThread %u\n", GetLastError ());
-      exit(1);
+      exit (1);
     }
   st->alarm_timeout.QuadPart = (5) * 10000000;
-  if (SetWaitableTimer (st->wtimer, &st->alarm_timeout, 0, NULL, NULL, FALSE) 
== 0)
+  if (SetWaitableTimer (st->wtimer, &st->alarm_timeout, 0, NULL, NULL, FALSE)
+      == 0)
     {
       fprintf (stderr, "error: SetWaitableTimer %u\n", GetLastError ());
-      exit(1);
+      exit (1);
     }
 #else
   alarm (5);
 #endif
-  
+
 }
 
 /* returns the elapsed time */
-double stop_benchmark(struct benchmark_st * st, const char* metric)
+double
+stop_benchmark (struct benchmark_st *st, const char *metric)
 {
   double secs;
   unsigned long lsecs;
@@ -123,24 +126,24 @@ double stop_benchmark(struct benchmark_st * st, const 
char* metric)
   double dspeed, ddata;
   char imetric[16];
 
-#if defined(_WIN32)
+#if defined _WIN32
   if (st->wtimer != NULL)
     CloseHandle (st->wtimer);
   if (st->wthread != NULL)
     CloseHandle (st->wthread);
 #else
-  signal(SIGALRM, st->old_handler);
+  signal (SIGALRM, st->old_handler);
 #endif
 
   gettime (&stop);
 
   lsecs = (stop.tv_sec * 1000 + stop.tv_nsec / (1000 * 1000) -
-          (st->start.tv_sec * 1000 + st->start.tv_nsec / (1000 * 1000)));
+          (st->start.tv_sec * 1000 + st->start.tv_nsec / (1000 * 1000)));
   secs = lsecs;
   secs /= 1000;
 
   if (metric == NULL)
-    { /* assume bytes/sec */
+    {                          /* assume bytes/sec */
       value2human (st->size, secs, &ddata, &dspeed, imetric);
       printf ("  Processed %.2f %s in %.2f secs: ", ddata, imetric, secs);
       printf ("%.2f %s/sec\n", dspeed, imetric);
diff --git a/src/benchmark.h b/src/benchmark.h
index e7d3386..4e952a5 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2011-2013 Free Software Foundation, Inc.
  *
  * This file is part of GnuTLS.
  *
@@ -20,19 +20,19 @@
 #include <sys/time.h>
 #include <time.h>
 #include <signal.h>
-#if defined(_WIN32)
-# include <windows.h>
+#if defined _WIN32
+#include <windows.h>
 #endif
-#include "timespec.h"           /* gnulib gettime */
+#include "timespec.h"          /* gnulib gettime */
 
-typedef void (*sighandler_t)(int);
+typedef void (*sighandler_t) (int);
 
 struct benchmark_st
 {
   struct timespec start;
   unsigned long size;
   sighandler_t old_handler;
-#if defined(_WIN32)
+#if defined _WIN32
   HANDLE wtimer;
   HANDLE wthread;
   LARGE_INTEGER alarm_timeout;
@@ -41,12 +41,12 @@ struct benchmark_st
 
 extern int benchmark_must_finish;
 
-void start_benchmark(struct benchmark_st * st);
-double stop_benchmark(struct benchmark_st * st, const char* metric);
+void start_benchmark (struct benchmark_st *st);
+double stop_benchmark (struct benchmark_st *st, const char *metric);
 
 inline static unsigned int
 timespec_sub_ms (struct timespec *a, struct timespec *b)
 {
   return (a->tv_sec * 1000 + a->tv_nsec / (1000 * 1000) -
-          (b->tv_sec * 1000 + b->tv_nsec / (1000 * 1000)));
+         (b->tv_sec * 1000 + b->tv_nsec / (1000 * 1000)));
 }
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8f01d35..10bdba1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #
diff --git a/tests/Test_encoding.asn b/tests/Test_encoding.asn
index 5db505c..5ecc1b2 100644
--- a/tests/Test_encoding.asn
+++ b/tests/Test_encoding.asn
@@ -16,7 +16,7 @@ Koko ::= SEQUENCE {
 
 END
 
--- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+-- Copyright (C) 2002-2013 Free Software Foundation, Inc.
 --
 -- This file is part of LIBTASN1.
 --
diff --git a/tests/Test_encoding.c b/tests/Test_encoding.c
index d6c7d57..e85210d 100644
--- a/tests/Test_encoding.c
+++ b/tests/Test_encoding.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -53,7 +53,7 @@ main (int argc, char *argv[])
       printf ("\n\n/****************************************/\n");
       printf ("/*     Test sequence : coding-decoding  */\n");
       printf ("/****************************************/\n\n");
-   }
+    }
 
   /* Check version */
   if (asn1_check_version ("0.3.3") == NULL)
@@ -130,6 +130,7 @@ main (int argc, char *argv[])
 
   asn1_delete_structure (&asn1_element);
 
-  if (verbose) printf ("Success\n");
+  if (verbose)
+    printf ("Success\n");
   exit (0);
 }
diff --git a/tests/Test_errors.c b/tests/Test_errors.c
index fcd1704..b5bb6b1 100644
--- a/tests/Test_errors.c
+++ b/tests/Test_errors.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2010-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -26,15 +26,15 @@ main (int argc, char *argv[])
   int ec = 0;
   const char *errstr;
   int verbose = 0;
-  
+
   if (argc > 1)
-    verbose = 1; 
+    verbose = 1;
 
   do
     {
       errstr = asn1_strerror (ec);
       if (verbose != 0)
-        asn1_perror (ec);
+       asn1_perror (ec);
       ec++;
     }
   while (errstr);
diff --git a/tests/Test_indefinite.c b/tests/Test_indefinite.c
index f06db4d..709a56a 100644
--- a/tests/Test_indefinite.c
+++ b/tests/Test_indefinite.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/tests/Test_overflow.c b/tests/Test_overflow.c
index fc8466b..bc3a25b 100644
--- a/tests/Test_overflow.c
+++ b/tests/Test_overflow.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -28,12 +28,12 @@
 #include "libtasn1.h"
 
 int
-main (int argc, char** argv)
+main (int argc, char **argv)
 {
   /* Test that values larger than long are rejected.  This has worked
      fine with all versions of libtasn1. */
   int verbose = 0;
-  
+
   if (argc > 1)
     verbose = 1;
 
@@ -46,7 +46,8 @@ main (int argc, char** argv)
 
     if (l == -2L)
       {
-        if (verbose) puts ("OK: asn1_get_length_der bignum");
+       if (verbose)
+         puts ("OK: asn1_get_length_der bignum");
       }
     else
       {
@@ -70,9 +71,10 @@ main (int argc, char** argv)
       l = asn1_get_length_der (der, der_len, &len);
 
       if (l == -2L)
-        {
-         if (verbose) puts ("OK: asn1_get_length_der intnum");
-        }
+       {
+         if (verbose)
+           puts ("OK: asn1_get_length_der intnum");
+       }
       else
        {
          printf ("ERROR: asn1_get_length_der intnum (l %ld len %d)\n", l,
@@ -83,81 +85,84 @@ main (int argc, char** argv)
 
   /* Test that values larger than would fit in the input string are
      rejected.  This problem was fixed in libtasn1 2.12. */
-    {
-      unsigned long num = 64;
-      unsigned char der[20];
-      int der_len;
-      long l;
-      int len;
+  {
+    unsigned long num = 64;
+    unsigned char der[20];
+    int der_len;
+    long l;
+    int len;
 
-      asn1_length_der (num, der, &der_len);
+    asn1_length_der (num, der, &der_len);
 
-      der_len = sizeof(der);
-      l = asn1_get_length_der (der, der_len, &len);
+    der_len = sizeof (der);
+    l = asn1_get_length_der (der, der_len, &len);
 
-      if (l == -4L)
-        {
-         if (verbose) puts ("OK: asn1_get_length_der overflow-small");
-        }
-      else
-       {
-         printf ("ERROR: asn1_get_length_der overflow-small (l %ld len %d)\n", 
l,
-                 len);
-         return 1;
-       }
-    }
+    if (l == -4L)
+      {
+       if (verbose)
+         puts ("OK: asn1_get_length_der overflow-small");
+      }
+    else
+      {
+       printf ("ERROR: asn1_get_length_der overflow-small (l %ld len %d)\n",
+               l, len);
+       return 1;
+      }
+  }
 
   /* Test that values larger than would fit in the input string are
      rejected.  This problem was fixed in libtasn1 2.12. */
-    {
-      unsigned long num = 1073741824;
-      unsigned char der[20];
-      int der_len;
-      long l;
-      int len;
+  {
+    unsigned long num = 1073741824;
+    unsigned char der[20];
+    int der_len;
+    long l;
+    int len;
 
-      asn1_length_der (num, der, &der_len);
+    asn1_length_der (num, der, &der_len);
 
-      der_len = sizeof(der);
-      l = asn1_get_length_der (der, der_len, &len);
+    der_len = sizeof (der);
+    l = asn1_get_length_der (der, der_len, &len);
 
-      if (l == -4L)
-        {
-         if (verbose) puts ("OK: asn1_get_length_der overflow-large1");
-        }
-      else
-       {
-         printf ("ERROR: asn1_get_length_der overflow-large1 (l %ld len 
%d)\n", l,
-                 len);
-         return 1;
-       }
-    }
+    if (l == -4L)
+      {
+       if (verbose)
+         puts ("OK: asn1_get_length_der overflow-large1");
+      }
+    else
+      {
+       printf ("ERROR: asn1_get_length_der overflow-large1 (l %ld len %d)\n",
+               l, len);
+       return 1;
+      }
+  }
 
   /* Test that values larger than would fit in the input string are
      rejected.  This problem was fixed in libtasn1 2.12. */
-    {
-      unsigned long num = 2147483649;
-      unsigned char der[20];
-      int der_len;
-      long l;
-      int len;
+  {
+    unsigned long num = 2147483649;
+    unsigned char der[20];
+    int der_len;
+    long l;
+    int len;
 
-      asn1_length_der (num, der, &der_len);
+    asn1_length_der (num, der, &der_len);
 
-      der_len = sizeof(der);
-      l = asn1_get_length_der (der, der_len, &len);
+    der_len = sizeof (der);
+    l = asn1_get_length_der (der, der_len, &len);
 
-      if (l == -2L)
-        {
-         if (verbose) puts ("OK: asn1_get_length_der overflow-large2");
-        }
-      else
-       {
-         printf ("ERROR: asn1_get_length_der overflow-large2 (l %ld len 
%d)\n", l,
-                 len);
-         return 1;
-       }
-    }
+    if (l == -2L)
+      {
+       if (verbose)
+         puts ("OK: asn1_get_length_der overflow-large2");
+      }
+    else
+      {
+       printf ("ERROR: asn1_get_length_der overflow-large2 (l %ld len %d)\n",
+               l, len);
+       return 1;
+      }
+  }
 
   return 0;
 }
diff --git a/tests/Test_parser.asn b/tests/Test_parser.asn
index 3f51fff..2e49d92 100644
--- a/tests/Test_parser.asn
+++ b/tests/Test_parser.asn
@@ -26,7 +26,7 @@ Bitstringsizetest ::= BIT STRING (SIZE(42))
 
 END
 
--- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+-- Copyright (C) 2002-2013 Free Software Foundation, Inc.
 --
 -- This file is part of LIBTASN1.
 --
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index 4ba1636..c988cba 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -47,7 +47,9 @@ test_type test_array[] = {
   /* Test DEFINITIONS syntax */
   {5,
    "TEST_PARSER2 { } DEFINITIONS IMPLICIT TAGS ::= BEGIN int1 ::= INTEGER END",
-   ASN1_SYNTAX_ERROR, _FILE_ ":6: Error: syntax error, unexpected IDENTIFIER, 
expecting $end near 'TEST_PARSER'"},
+   ASN1_SYNTAX_ERROR,
+   _FILE_
+   ":6: Error: syntax error, unexpected IDENTIFIER, expecting $end near 
'TEST_PARSER'"},
   {6, "TEST_PARSER { }", ASN1_SUCCESS, ""},
 
   /* Test ASN1_MAX_NAME_SIZE (128) */
@@ -79,13 +81,18 @@ test_type test_array[] = {
   {14, "int1 [1] IMPLICIT INTEGER,", ASN1_SUCCESS, ""},
   {12, "Integer ::= [1] EXPLICIT INTEGER {v1(-1), v2(1)}", ASN1_SUCCESS, ""},
   {12, "Integer ::= INTEGER {v1(0), v2}",
-   ASN1_SYNTAX_ERROR, _FILE_ ":12: Error: syntax error, unexpected '}', 
expecting '(' near '}'"},
+   ASN1_SYNTAX_ERROR,
+   _FILE_ ":12: Error: syntax error, unexpected '}', expecting '(' near '}'"},
   {12, "Integer ::= INTEGER {v1(0), 1}",
-   ASN1_SYNTAX_ERROR, _FILE_ ":12: Error: syntax error, unexpected NUM, 
expecting IDENTIFIER or '(' near '1'"},
+   ASN1_SYNTAX_ERROR,
+   _FILE_
+   ":12: Error: syntax error, unexpected NUM, expecting IDENTIFIER or '(' near 
'1'"},
   {12, "const1 INTEGER ::= -1", ASN1_SUCCESS, ""},
   {12, "const1 INTEGER ::= 1", ASN1_SUCCESS, ""},
   {12, "const1 INTEGER ::= v1",
-   ASN1_SYNTAX_ERROR, _FILE_ ":12: Error: syntax error, unexpected IDENTIFIER, 
expecting NUM or '+' or '-' near 'v1'"},
+   ASN1_SYNTAX_ERROR,
+   _FILE_
+   ":12: Error: syntax error, unexpected IDENTIFIER, expecting NUM or '+' or 
'-' near 'v1'"},
   {16, " generic generalstring",
    ASN1_IDENTIFIER_NOT_FOUND,
    _FILE_ ":: identifier 'generalstring' not found"},
@@ -96,7 +103,8 @@ test_type test_array[] = {
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT 1",
    ASN1_IDENTIFIER_NOT_FOUND, _FILE_ ":: identifier '1' not found"},
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT",
-   ASN1_SYNTAX_ERROR, _FILE_ ":21: Error: syntax error, unexpected '}' near 
'}'"},
+   ASN1_SYNTAX_ERROR,
+   _FILE_ ":21: Error: syntax error, unexpected '}' near '}'"},
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT Oid-type1",
    ASN1_SUCCESS, ""},
 
@@ -153,7 +161,7 @@ main (int argc, char *argv[])
   test_type *test;
   int errorCounter = 0, testCounter = 0;
   int verbose = 0;
-  
+
   if (argc > 1)
     verbose = 1;
 
@@ -208,7 +216,7 @@ main (int argc, char *argv[])
                  asn1_strerror (test->errorNumber), test->errorDescription);
          printf ("  Error detected: %s - %s\n\n", asn1_strerror (result),
                  errorDescription);
-          exit(1);
+         exit (1);
        }
 
       test++;
diff --git a/tests/Test_simple.c b/tests/Test_simple.c
index b6bb53d..c85f0dd 100644
--- a/tests/Test_simple.c
+++ b/tests/Test_simple.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2011-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/tests/Test_strings.c b/tests/Test_strings.c
index b43620f..a69774a 100644
--- a/tests/Test_strings.c
+++ b/tests/Test_strings.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -36,16 +36,22 @@ struct tv
 };
 
 static const struct tv tv[] = {
-  {ASN1_ETYPE_IA5_STRING, 20, 
"\x63\x73\x63\x61\x40\x70\x61\x73\x73\x70\x6f\x72\x74\x2e\x67\x6f\x76\x2e\x67\x72",
-                          22, 
"\x16\x14\x63\x73\x63\x61\x40\x70\x61\x73\x73\x70\x6f\x72\x74\x2e\x67\x6f\x76\x2e\x67\x72"},
-  {ASN1_ETYPE_PRINTABLE_STRING, 5, "\x4e\x69\x6b\x6f\x73", 
-                               7, "\x13\x05\x4e\x69\x6b\x6f\x73"},
+  {ASN1_ETYPE_IA5_STRING, 20,
+   
"\x63\x73\x63\x61\x40\x70\x61\x73\x73\x70\x6f\x72\x74\x2e\x67\x6f\x76\x2e\x67\x72",
+   22,
+   
"\x16\x14\x63\x73\x63\x61\x40\x70\x61\x73\x73\x70\x6f\x72\x74\x2e\x67\x6f\x76\x2e\x67\x72"},
+  {ASN1_ETYPE_PRINTABLE_STRING, 5, "\x4e\x69\x6b\x6f\x73",
+   7, "\x13\x05\x4e\x69\x6b\x6f\x73"},
   {ASN1_ETYPE_UTF8_STRING, 12, "Αττική",
-                          14, 
"\x0c\x0c\xce\x91\xcf\x84\xcf\x84\xce\xb9\xce\xba\xce\xae"},
-  {ASN1_ETYPE_TELETEX_STRING, 15, 
"\x53\x69\x6d\x6f\x6e\x20\x4a\x6f\x73\x65\x66\x73\x73\x6f\x6e",
-                             17, 
"\x14\x0f\x53\x69\x6d\x6f\x6e\x20\x4a\x6f\x73\x65\x66\x73\x73\x6f\x6e"},
-  {ASN1_ETYPE_OCTET_STRING, 36, 
"\x30\x22\x80\x0F\x32\x30\x31\x31\x30\x38\x32\x31\x30\x38\x30\x30\x30\x36\x5A\x81\x0F\x32\x30\x31\x31\x30\x38\x32\x33\x32\x30\x35\x39\x35\x39\x5A",
-                           38, 
"\x04\x24\x30\x22\x80\x0F\x32\x30\x31\x31\x30\x38\x32\x31\x30\x38\x30\x30\x30\x36\x5A\x81\x0F\x32\x30\x31\x31\x30\x38\x32\x33\x32\x30\x35\x39\x35\x39\x5A"}
+   14, "\x0c\x0c\xce\x91\xcf\x84\xcf\x84\xce\xb9\xce\xba\xce\xae"},
+  {ASN1_ETYPE_TELETEX_STRING, 15,
+   "\x53\x69\x6d\x6f\x6e\x20\x4a\x6f\x73\x65\x66\x73\x73\x6f\x6e",
+   17,
+   "\x14\x0f\x53\x69\x6d\x6f\x6e\x20\x4a\x6f\x73\x65\x66\x73\x73\x6f\x6e"},
+  {ASN1_ETYPE_OCTET_STRING, 36,
+   
"\x30\x22\x80\x0F\x32\x30\x31\x31\x30\x38\x32\x31\x30\x38\x30\x30\x30\x36\x5A\x81\x0F\x32\x30\x31\x31\x30\x38\x32\x33\x32\x30\x35\x39\x35\x39\x5A",
+   38,
+   
"\x04\x24\x30\x22\x80\x0F\x32\x30\x31\x31\x30\x38\x32\x31\x30\x38\x30\x30\x30\x36\x5A\x81\x0F\x32\x30\x31\x31\x30\x38\x32\x33\x32\x30\x35\x39\x35\x39\x5A"}
 };
 
 int
@@ -54,7 +60,7 @@ main (int argc, char *argv[])
   int ret;
   unsigned char tl[ASN1_MAX_TL_SIZE];
   unsigned int tl_len, der_len, str_len;
-  const unsigned char* str;
+  const unsigned char *str;
   unsigned int i;
 
   /* Dummy test */
@@ -62,35 +68,43 @@ main (int argc, char *argv[])
   for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
     {
       /* Encode */
-      tl_len = sizeof(tl);
-      ret = asn1_encode_simple_der(tv[i].etype, tv[i].str, tv[i].str_len,
-                                   tl, &tl_len);
+      tl_len = sizeof (tl);
+      ret = asn1_encode_simple_der (tv[i].etype, tv[i].str, tv[i].str_len,
+                                   tl, &tl_len);
       if (ret != ASN1_SUCCESS)
-        {
-          fprintf(stderr, "Encoding error in %u: %s\n", i, asn1_strerror(ret));
-          return 1;
-        }
-      der_len = tl_len+tv[i].str_len;
-        
-      if (der_len != tv[i].der_len || memcmp(tl, tv[i].der, tl_len) != 0)
-        {
-          fprintf(stderr, "DER encoding differs in %u! (size: %u, expected: 
%u)\n", i, der_len, tv[i].der_len);
-          return 1;
-        }
+       {
+         fprintf (stderr, "Encoding error in %u: %s\n", i,
+                  asn1_strerror (ret));
+         return 1;
+       }
+      der_len = tl_len + tv[i].str_len;
+
+      if (der_len != tv[i].der_len || memcmp (tl, tv[i].der, tl_len) != 0)
+       {
+         fprintf (stderr,
+                  "DER encoding differs in %u! (size: %u, expected: %u)\n",
+                  i, der_len, tv[i].der_len);
+         return 1;
+       }
 
       /* decoding */
-      ret = asn1_decode_simple_der(tv[i].etype, tv[i].der, tv[i].der_len, 
&str, &str_len);
+      ret =
+       asn1_decode_simple_der (tv[i].etype, tv[i].der, tv[i].der_len, &str,
+                               &str_len);
       if (ret != ASN1_SUCCESS)
-        {
-          fprintf(stderr, "Decoding error in %u: %s\n", i, asn1_strerror(ret));
-          return 1;
-        }
+       {
+         fprintf (stderr, "Decoding error in %u: %s\n", i,
+                  asn1_strerror (ret));
+         return 1;
+       }
 
-      if (str_len != tv[i].str_len || memcmp(str, tv[i].str, str_len) != 0)
-        {
-          fprintf(stderr, "DER decoded data differ in %u! (size: %u, expected: 
%u)\n", i, der_len, tv[i].str_len);
-          return 1;
-        }
+      if (str_len != tv[i].str_len || memcmp (str, tv[i].str, str_len) != 0)
+       {
+         fprintf (stderr,
+                  "DER decoded data differ in %u! (size: %u, expected: %u)\n",
+                  i, der_len, tv[i].str_len);
+         return 1;
+       }
     }
 
 
diff --git a/tests/Test_tree.asn b/tests/Test_tree.asn
index b480f6d..b631eb7 100644
--- a/tests/Test_tree.asn
+++ b/tests/Test_tree.asn
@@ -159,7 +159,7 @@ id-Test OBJECT IDENTIFIER  ::=  {1 2 29 2}
 
 END
 
--- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+-- Copyright (C) 2002-2013 Free Software Foundation, Inc.
 --
 -- This file is part of LIBTASN1.
 --
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index bcd3cbe..c44777e 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2013 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -95,30 +95,37 @@ test_type test_array[] = {
   {ACT_WRITE, "validity", 0, 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer", "rdnSequence", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.3", 0, ASN1_SUCCESS, 
__LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.3", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
    
"\x0c\x18\x71\x75\x61\x73\x61\x72\x2e\x6c\x61\x73\x2e\x69\x63\x2e\x75\x6e\x69\x63\x61\x6d\x70\x2e\x62\x72",
    26, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.7", 0, ASN1_SUCCESS, 
__LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.7", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
    "\x0c\x08\x43\x61\x6d\x70\x69\x6e\x61\x73", 10, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.6", 0, ASN1_SUCCESS, 
__LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.6", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
    "\x13\x06\x42\x72\x61\x73\x69\x6c", 8, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.10", 0, ASN1_SUCCESS, 
__LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.10", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value", "\x0c\x02\x49\x43", 4,
    ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.11", 0, ASN1_SUCCESS, 
__LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.11", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value", "\x0c\x03\x4c\x41\x53", 5,
    ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.8", 0, ASN1_SUCCESS, 
__LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.8", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
-   "\x0c\x09\x53\x61\x6f\x20\x50\x61\x75\x6c\x6f", 11, ASN1_SUCCESS, __LINE__},
+   "\x0c\x09\x53\x61\x6f\x20\x50\x61\x75\x6c\x6f", 11, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "1.2.840.113549.1.9.1", 0,
    ASN1_SUCCESS, __LINE__},
@@ -134,12 +141,16 @@ test_type test_array[] = {
   {ACT_CREATE, "TEST_TREE.CertTemplate", 0, 0, ASN1_SUCCESS, __LINE__},
   {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
   {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?1", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?1", "", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?1", "", 0,
    ASN1_ELEMENT_NOT_FOUND, __LINE__},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?3", "", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?5", "", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?7", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?3", "", 0, ASN1_SUCCESS,
+   __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?5", "", 0, ASN1_SUCCESS,
+   __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?7", "", 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
   {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
@@ -162,7 +173,8 @@ test_type test_array[] = {
   {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: Indefinite Length */
-  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_WRITE, "int1", "1", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "seq1.int", "2", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "set1", "NEW", 0, ASN1_SUCCESS, __LINE__},
@@ -175,7 +187,8 @@ test_type test_array[] = {
    
"\x30\x18\xa1\x80\x02\x01\x02\x00\x00\x31\x80\x06\x03\x2a\x03\x04\x06\x03\x2a\x05\x06\x00\x00\x02\x01\x01",
    0, 26, ASN1_SUCCESS, __LINE__},
   {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
-  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS,
+   __LINE__},
   {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
   {ACT_DECODING_START_END, "seq1", "START", 2, ASN1_SUCCESS, __LINE__},
   {ACT_DECODING_START_END, "seq1", "END", 8, ASN1_SUCCESS, __LINE__},
@@ -251,8 +264,10 @@ test_type test_array[] = {
   /* Test: READ TAG and CLASS */
   {ACT_CREATE, "TEST_TREE.SequenceTestTag", 0, 0, ASN1_SUCCESS, __LINE__},
   {ACT_READ_TAG_CLASS, "int", "", 0, ASN1_ELEMENT_NOT_FOUND, __LINE__},
-  {ACT_READ_TAG_CLASS, "int1", "TAG", ASN1_TAG_INTEGER, ASN1_SUCCESS, 
__LINE__},
-  {ACT_READ_TAG_CLASS, "int1", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS, 
__LINE__},
+  {ACT_READ_TAG_CLASS, "int1", "TAG", ASN1_TAG_INTEGER, ASN1_SUCCESS,
+   __LINE__},
+  {ACT_READ_TAG_CLASS, "int1", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS,
+   __LINE__},
   {ACT_READ_TAG_CLASS, "int2", "TAG", 3, ASN1_SUCCESS, __LINE__},
   {ACT_READ_TAG_CLASS, "int2", "CLASS", ASN1_CLASS_CONTEXT_SPECIFIC,
    ASN1_SUCCESS, __LINE__},
@@ -260,9 +275,11 @@ test_type test_array[] = {
   {ACT_READ_TAG_CLASS, "str1", "CLASS", ASN1_CLASS_CONTEXT_SPECIFIC,
    ASN1_SUCCESS, __LINE__},
   {ACT_READ_TAG_CLASS, "str2", "TAG", 28, ASN1_SUCCESS, __LINE__},
-  {ACT_READ_TAG_CLASS, "str2", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS, 
__LINE__},
+  {ACT_READ_TAG_CLASS, "str2", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS,
+   __LINE__},
   {ACT_READ_TAG_CLASS, "str3", "TAG", 28, ASN1_SUCCESS, __LINE__},
-  {ACT_READ_TAG_CLASS, "str3", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS, 
__LINE__},
+  {ACT_READ_TAG_CLASS, "str3", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS,
+   __LINE__},
   {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
   {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
@@ -277,7 +294,8 @@ test_type test_array[] = {
   {ACT_READ, "id", "2.5.29.2", 9, ASN1_SUCCESS, __LINE__},
   {ACT_READ_LENGTH, "id", NULL, 9, ASN1_MEM_ERROR, __LINE__},
   {ACT_WRITE, "any1", "\x02\x01\x05", 3, ASN1_SUCCESS, __LINE__},
-  {ACT_READ_DEFINITIONS, "TEST_TREE.id-anyTest", "2.5.29.1", 9, ASN1_SUCCESS, 
__LINE__},
+  {ACT_READ_DEFINITIONS, "TEST_TREE.id-anyTest", "2.5.29.1", 9, ASN1_SUCCESS,
+   __LINE__},
   {ACT_ENCODING_LENGTH, "", 0, 20, ASN1_MEM_ERROR, __LINE__},
   {ACT_ENCODING, "", 0, 19, ASN1_MEM_ERROR, __LINE__},
   {ACT_ENCODING, "", 0, 200, ASN1_SUCCESS, __LINE__},
@@ -448,7 +466,7 @@ main (int argc, char *argv[])
   int start, end, verbose = 0;
   const char *str_p = NULL;
   const char *treefile = getenv ("ASN1TREE");
-  
+
   if (argc > 1)
     verbose = 1;
 
@@ -582,20 +600,21 @@ main (int argc, char *argv[])
        case ACT_VISIT:
          if (verbose)
            {
-             asn1_print_structure (out, asn1_element, test->par1, test->par3);
-              fprintf (out, "\n");
-            }  
+             asn1_print_structure (out, asn1_element, test->par1,
+                                   test->par3);
+             fprintf (out, "\n");
+           }
          result = ASN1_SUCCESS;
          break;
        case ACT_PRINT_DER:
          if (verbose)
            {
-              printf ("DER encoding len:%i\n", der_len);
-              printf ("DER encoding: ");
-              for (k = 0; k < der_len; k++)
-                printf ("%02x ", der[k]);
+             printf ("DER encoding len:%i\n", der_len);
+             printf ("DER encoding: ");
+             for (k = 0; k < der_len; k++)
+               printf ("%02x ", der[k]);
              printf ("\n\n");
-            }
+           }
          result = ASN1_SUCCESS;
          break;
        case ACT_SET_DER:
@@ -634,7 +653,7 @@ main (int argc, char *argv[])
              printf ("  Error expected: %s\n",
                      asn1_strerror (test->errorNumber));
              printf ("  Error detected: %s\n\n", asn1_strerror (result));
-             error();
+             error ();
            }
          break;
        case ACT_DECODING_ELEMENT:
@@ -648,7 +667,7 @@ main (int argc, char *argv[])
                      asn1_strerror (test->errorNumber));
              printf ("  Error detected: %s\n", asn1_strerror (result));
              printf ("  Error description : %s\n\n", errorDescription);
-             error();
+             error ();
            }
          break;
        case ACT_NUMBER_OF_ELEMENTS:
@@ -662,7 +681,7 @@ main (int argc, char *argv[])
                      asn1_strerror (test->errorNumber), test->par3);
              printf ("  Error detected: %s - %d\n\n", asn1_strerror (result),
                      valueLen);
-             error();
+             error ();
            }
          break;
        case ACT_ENCODING_LENGTH:
@@ -675,7 +694,7 @@ main (int argc, char *argv[])
                      asn1_strerror (test->errorNumber), test->par3);
              printf ("  Error detected: %s - %d\n\n", asn1_strerror (result),
                      der_len);
-             error();
+             error ();
            }
          break;
        case ACT_OID_2_STRUCTURE:
@@ -690,7 +709,7 @@ main (int argc, char *argv[])
              printf ("  Error expected: %s - %s\n",
                      asn1_strerror (test->errorNumber), test->par2);
              printf ("  Value detected: %s\n\n", str_p);
-             error();
+             error ();
            }
          break;
        case ACT_DECODING_START_END:
@@ -707,7 +726,7 @@ main (int argc, char *argv[])
                      test->par3);
              printf ("  Error detected: %s - %d - %d\n\n",
                      asn1_strerror (result), start, end);
-             error();
+             error ();
            }
          break;
 
@@ -725,7 +744,7 @@ main (int argc, char *argv[])
                      test->par3);
              printf ("  Error detected: %s - %d - %d\n\n",
                      asn1_strerror (result), tag, class);
-             error();
+             error ();
            }
 
          break;
@@ -768,7 +787,7 @@ main (int argc, char *argv[])
                printf ("%02x", value[k]);
              printf ("\n\n");
 
-             error();
+             error ();
            }
 
          break;
diff --git a/tests/benchmark b/tests/benchmark
index 17a006a..c60381d 100755
--- a/tests/benchmark
+++ b/tests/benchmark
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 #
 # Author: Simon Josefsson
 #
diff --git a/tests/crlf b/tests/crlf
index e2f88cc..9e3a1d4 100755
--- a/tests/crlf
+++ b/tests/crlf
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 #
 # Author: Simon Josefsson
 #
diff --git a/tests/pkix.asn b/tests/pkix.asn
index 40dc28c..64c7146 100644
--- a/tests/pkix.asn
+++ b/tests/pkix.asn
@@ -1240,7 +1240,7 @@ XmppAddr ::= UTF8String
 
 END
 
--- Copyright (C) 2002-2012 Free Software Foundation, Inc.
+-- Copyright (C) 2002-2013 Free Software Foundation, Inc.
 --
 -- This file is part of LIBTASN1.
 --
diff --git a/tests/threadsafety b/tests/threadsafety
index 6d2a4fb..d8a8b3b 100755
--- a/tests/threadsafety
+++ b/tests/threadsafety
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 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
diff --git a/windows/libtasn14win.mk b/windows/libtasn14win.mk
index d832ccf..efae72b 100644
--- a/windows/libtasn14win.mk
+++ b/windows/libtasn14win.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 #
 # This file is part of LIBTASN1.
 #


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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