libidn-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libidn branch, master, updated. libidn-1-26-38-g644cadc


From: Simon Josefsson
Subject: [SCM] GNU libidn branch, master, updated. libidn-1-26-38-g644cadc
Date: Wed, 05 Jun 2013 20:30:15 +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 libidn".

http://git.savannah.gnu.org/cgit/libidn.git/commit/?id=644cadc45ef7ce6613b9d171cb8b9d5213b1a268

The branch, master has been updated
       via  644cadc45ef7ce6613b9d171cb8b9d5213b1a268 (commit)
       via  94d96a65bc26e2b4b0779c42e978a5a186f52a4c (commit)
       via  d238a1678d142ef7bc00bca351a81205afb123eb (commit)
       via  af6435ee6e7bbb1dd84b38863bbc2de89832fc05 (commit)
       via  1c99ba89a3528bcbf5e2881b93040545fc5878dc (commit)
       via  3e24bb1d4d9633d6c38fa74032c52fca59355822 (commit)
       via  5871d5272e04543015bbdc20e9fda111626cce38 (commit)
       via  0fab727b7d8178f85cd3d6a1a8e1702d9bf39cc5 (commit)
       via  6ee276f1ac733dd7ae01f8e1182e5a3d2f3c63bf (commit)
       via  bd11040e8d1825826658fed8258b93ed9701c912 (commit)
       via  3b468829b33f091d620657e334b51b8a32f28a44 (commit)
       via  c6d2e61335d23f29890d372daded9b8f67127e0a (commit)
       via  66c49e8807635796314b56fd07bff00e10bd309e (commit)
       via  4f1169dc9cd690143eea23331d7e24fbf9e6c5f1 (commit)
       via  fe4a9c890c046b76da477b4194070c36e2a30ec9 (commit)
       via  741f015b1011776f8b8f1f2dd3eb56ac570898ba (commit)
       via  50a591c988eaa431395c18cf3c67ff473273812d (commit)
       via  b54e82e6fb672ef15137e590fb6502fde50465d8 (commit)
       via  338cec08481360f361bb0dc7d422acc3c88e7943 (commit)
       via  2ddb9e5fb3fcdb2f53d1fa163c4de284f6a40702 (commit)
       via  ae52b2425981282158454ccda2c0e96c8d23eff5 (commit)
       via  8b65f72cebf67e54de0be05368f2b0a25cc76f3f (commit)
       via  97490f090c2abb24ecc1a668a7adef84a82b9598 (commit)
       via  79797442b704e919abf0f232a3eacc7554f0989e (commit)
       via  2dfa483b59a8fe890553861ea0b04f594720bccc (commit)
       via  edea71b94aa2dcf482b87268145fb7a56a6f12ec (commit)
       via  438eab43d0f5c7e9fe0b4f7014e8e47a03b981c7 (commit)
       via  79844693e63d449522f0245a5df351bdb580e2f3 (commit)
       via  9422b7127bfb9f2b649a7d8583a86f0a934023be (commit)
       via  c263ddf3f17db1dd61b807628c98f209786c43e6 (commit)
       via  3417b02e6e2019bafab0a22724643aaccd9294ad (commit)
       via  5b0d6829e4d39ca20faa861c2eb1c2157db17837 (commit)
       via  4453b7527e7810c04beb463abdc3cc3c3b86ff6c (commit)
       via  f5f65845c6beb0d61162cabcd41604169a9b6ab0 (commit)
      from  0a8d3d79f8c41da07075d5feb3624ef7ddabdafb (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 644cadc45ef7ce6613b9d171cb8b9d5213b1a268
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 22:18:20 2013 +0200

    Version 1.27.

commit 94d96a65bc26e2b4b0779c42e978a5a186f52a4c
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 21:43:03 2013 +0200

    Add.

commit d238a1678d142ef7bc00bca351a81205afb123eb
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 21:40:34 2013 +0200

    Add NEWS blurbs.

commit af6435ee6e7bbb1dd84b38863bbc2de89832fc05
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 21:20:23 2013 +0200

    Fix syntax-check nits.

commit 1c99ba89a3528bcbf5e2881b93040545fc5878dc
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 21:12:21 2013 +0200

    Update copyright years.

commit 3e24bb1d4d9633d6c38fa74032c52fca59355822
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 21:11:23 2013 +0200

    Sync with TP.

commit 5871d5272e04543015bbdc20e9fda111626cce38
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 21:07:16 2013 +0200

    Update gnulib files.

commit 0fab727b7d8178f85cd3d6a1a8e1702d9bf39cc5
Author: Simon Josefsson <address@hidden>
Date:   Wed Jun 5 20:57:08 2013 +0200

    Fix .gitignore for new java stuff.

commit 6ee276f1ac733dd7ae01f8e1182e5a3d2f3c63bf
Author: stela <address@hidden>
Date:   Thu May 2 23:18:21 2013 +0200

    Added missing copyright headers. Describe how to use caliper benchmarks 
with jenkins/hudson + caliper-ci.
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit bd11040e8d1825826658fed8258b93ed9701c912
Author: stela <address@hidden>
Date:   Mon Apr 29 23:18:53 2013 +0200

    Upgraded (test) dependencies and mvn plugins to latest versions
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 3b468829b33f091d620657e334b51b8a32f28a44
Author: stela <address@hidden>
Date:   Mon Apr 29 23:17:27 2013 +0200

    Avoid using deprecared junit classes
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit c6d2e61335d23f29890d372daded9b8f67127e0a
Author: stela <address@hidden>
Date:   Fri Feb 8 23:12:15 2013 +0100

    First do simplistic check if input is all within common pass-through 
ranges. Speeds up common inputs up to about 25%.
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 66c49e8807635796314b56fd07bff00e10bd309e
Author: stela <address@hidden>
Date:   Fri Feb 8 22:25:16 2013 +0100

    Eliminate length-calculations, minor cleanups
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 4f1169dc9cd690143eea23331d7e24fbf9e6c5f1
Author: stela <address@hidden>
Date:   Fri Feb 8 03:07:38 2013 +0100

    Optimize search for head-range, don't binary-search past end-index of 
highest character
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit fe4a9c890c046b76da477b4194070c36e2a30ec9
Author: stela <address@hidden>
Date:   Thu Feb 7 22:53:47 2013 +0100

    Optimize search for head-range, don't binary-search past end-index of 
highest character
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 741f015b1011776f8b8f1f2dd3eb56ac570898ba
Author: stela <address@hidden>
Date:   Sun Feb 3 23:48:12 2013 +0100

    First check most significant gap (exists if it contains the letter "a") in 
the ranges, often provides fast-fail
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 50a591c988eaa431395c18cf3c67ff473273812d
Author: stela <address@hidden>
Date:   Tue Jan 29 23:10:17 2013 +0100

    Filter using RangeSet, reverse loops order
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit b54e82e6fb672ef15137e590fb6502fde50465d8
Author: stela <address@hidden>
Date:   Tue Jan 29 23:09:05 2013 +0100

    normalizeNFKC pre-allocates output, pre-calculate fixed input length
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 338cec08481360f361bb0dc7d422acc3c88e7943
Author: stela <address@hidden>
Date:   Wed Jan 23 23:43:53 2013 +0100

    Replaced all contains methods with RangeSet operations.
    
    Made resourceprep faster, others slightly slower. Less redundant code to 
maintain/optimize later though
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 2ddb9e5fb3fcdb2f53d1fa163c4de284f6a40702
Author: stela <address@hidden>
Date:   Wed Jan 23 00:06:23 2013 +0100

    Added RangeSet implementation used for stringprep-table-contains lookups. 
Made nodeprep twice as fast, nameprep slightly faster, overall 20-40% faster.
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit ae52b2425981282158454ccda2c0e96c8d23eff5
Author: stela <address@hidden>
Date:   Mon Nov 12 23:34:09 2012 +0100

    If tested text characters all below char to match (out of sorted set), 
abort as remaining higher chars won't be matched either
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 8b65f72cebf67e54de0be05368f2b0a25cc76f3f
Author: stela <address@hidden>
Date:   Mon Nov 12 23:21:01 2012 +0100

    Don't do redundant StringBuilder length() or charAt() calls when doing 
contains-checks
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 97490f090c2abb24ecc1a668a7adef84a82b9598
Author: stela <address@hidden>
Date:   Mon Nov 12 23:01:34 2012 +0100

    Do character-replacement lookups through binary search instead of linear 
search
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 79797442b704e919abf0f232a3eacc7554f0989e
Author: stela <address@hidden>
Date:   Mon Nov 12 22:46:11 2012 +0100

    Replace synchronized StringBuffer with faster unsynchronized StringBuilder
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 2dfa483b59a8fe890553861ea0b04f594720bccc
Author: stela <address@hidden>
Date:   Mon Nov 12 22:10:22 2012 +0100

    Added caliper tests for common types of stringprep operations. Allows use 
of jenkins + caliper-ci to produce nice graphs of improvements per release.
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit edea71b94aa2dcf482b87268145fb7a56a6f12ec
Author: stela <address@hidden>
Date:   Mon Nov 12 21:57:15 2012 +0100

    Revert from fast StringBuilder to slow StringBuffer for now just to 
establish a performance baseline.
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 438eab43d0f5c7e9fe0b4f7014e8e47a03b981c7
Author: stela <address@hidden>
Date:   Sat Nov 3 01:06:08 2012 +0100

    Added test cases converted from C version. Avoid reading first character of 
empty strings, happened when a zero width space is converted to nothing.
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 79844693e63d449522f0245a5df351bdb580e2f3
Author: stela <address@hidden>
Date:   Sat Nov 3 00:50:21 2012 +0100

    Change comments from stringbuffer to StringBuilder as well
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 9422b7127bfb9f2b649a7d8583a86f0a934023be
Author: stela <address@hidden>
Date:   Fri Nov 2 23:39:25 2012 +0100

    Make example3/4/5.c compile on Ubuntu 12.04 LTS, cast %ld printf arguments
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit c263ddf3f17db1dd61b807628c98f209786c43e6
Author: stela <address@hidden>
Date:   Fri Nov 2 08:29:26 2012 +0100

    Make example.c compile on Ubuntu 12.04 LTS, cast %ld printf arguments
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 3417b02e6e2019bafab0a22724643aaccd9294ad
Author: stela <address@hidden>
Date:   Sun Sep 2 21:33:53 2012 +0200

    Replace needlessly synchronized StringBuffer with StringBuilder everywhere, 
benchmarked to result in roughly 4x stringprep speedup
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 5b0d6829e4d39ca20faa861c2eb1c2157db17837
Author: stela <address@hidden>
Date:   Sat Sep 1 02:28:07 2012 +0200

    Make maven build with new directory structure.
    
    Added maven configuration to at least avoid warnings when building and make 
build reproducible
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit 4453b7527e7810c04beb463abdc3cc3c3b86ff6c
Author: stela <address@hidden>
Date:   Sat Sep 1 01:12:35 2012 +0200

    Use standard maven directory structure, but still allow building with make.
    
    Moved java sources into java/src/main/java instead of plain "java".
    Created empty src/test/java for future unit test cases.
    Moved code-generation and test classes into src/util/java instead of "misc"
    Adapted make files for changed paths
    
    Signed-off-by: Simon Josefsson <address@hidden>

commit f5f65845c6beb0d61162cabcd41604169a9b6ab0
Author: stela <address@hidden>
Date:   Sat Sep 1 01:01:48 2012 +0200

    Use standard maven directory structure, but still allow building with make.
    
    Moved java sources into java/src/main/java instead of plain "java".
    Created empty src/test/java for future unit test cases.
    Moved code-generation and test classes into src/util/java instead of "misc"
    Adapted make files for changed paths

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

Summary of changes:
 .clcopying                                         |    2 +-
 .gitignore                                         |   56 ++--
 AUTHORS                                            |    5 +-
 COPYING                                            |    2 +-
 FAQ                                                |    2 +-
 GNUmakefile                                        |    2 +-
 HACKING                                            |    2 +-
 Makefile.am                                        |    2 +-
 NEWS                                               |   10 +-
 README                                             |    2 +-
 THANKS                                             |    2 +-
 TODO                                               |    2 +-
 build-aux/config.rpath                             |    2 +-
 build-aux/csharpcomp.sh.in                         |    2 +-
 build-aux/csharpexec.sh.in                         |    2 +-
 build-aux/gendocs.sh                               |  172 +++++----
 build-aux/gnupload                                 |   25 +-
 build-aux/pmccabe2html                             |    2 +-
 build-aux/snippet/arg-nonnull.h                    |    2 +-
 build-aux/snippet/c++defs.h                        |    2 +-
 build-aux/snippet/unused-parameter.h               |    2 +-
 build-aux/snippet/warn-on-use.h                    |    2 +-
 build-aux/update-copyright                         |    6 +-
 build-aux/useless-if-before-free                   |    2 +-
 build-aux/vc-list-files                            |    2 +-
 cfg.mk                                             |    2 +-
 configure.ac                                       |   19 +-
 contrib/README                                     |    2 +-
 contrib/doxygen/gdoc2doxygen                       |    2 +-
 contrib/java/Makefile.am                           |    2 +-
 contrib/java/README                                |    2 +-
 csharp/AssemblyInfo.cs                             |    2 +-
 csharp/IDNA.cs                                     |    2 +-
 csharp/IDNAException.cs                            |    2 +-
 csharp/Makefile.am                                 |    2 +-
 csharp/NFKC.cs                                     |    2 +-
 csharp/Punycode.cs                                 |    2 +-
 csharp/PunycodeException.cs                        |    2 +-
 csharp/Stringprep.cs                               |    2 +-
 csharp/StringprepException.cs                      |    2 +-
 csharp/generate/AssemblyInfo.cs                    |    2 +-
 csharp/generate/GenerateNFKC.cs                    |    2 +-
 csharp/generate/GenerateRFC3454.cs                 |    2 +-
 csharp/generate/HashSet.cs                         |    2 +-
 csharp/generate/Program.cs                         |    2 +-
 csharp/generate/Tokenizer.cs                       |    2 +-
 doc/Makefile.am                                    |    4 +-
 doc/cyclo/Makefile.am                              |    2 +-
 doc/gdoc                                           |    2 +-
 doc/gdoc.mk                                        |    2 +-
 doc/gendocs_template                               |    2 +-
 doc/java/Makefile.am                               |    6 +-
 doc/libidn.texi                                    |    2 +-
 doc/tld/Makefile.am                                |    2 +-
 doc/tld/README                                     |    2 +-
 doc/tld/fr.tld                                     |    2 +-
 doc/tld/no.tld                                     |    2 +-
 examples/Makefile.am                               |    2 +-
 examples/README                                    |    2 +-
 examples/example.c                                 |    8 +-
 examples/example2.c                                |    2 +-
 examples/example3.c                                |    6 +-
 examples/example4.c                                |    6 +-
 examples/example5.c                                |    8 +-
 gl/Makefile.am                                     |    4 +-
 gl/errno.in.h                                      |    2 +-
 gl/error.c                                         |    2 +-
 gl/error.h                                         |    2 +-
 gl/getopt.c                                        |    2 +-
 gl/getopt.in.h                                     |    4 +-
 gl/getopt1.c                                       |    2 +-
 gl/getopt_int.h                                    |    2 +-
 gl/gettext.h                                       |    2 +-
 gl/intprops.h                                      |    4 +-
 gl/m4/00gnulib.m4                                  |    2 +-
 gl/m4/alloca.m4                                    |    2 +-
 gl/m4/autobuild.m4                                 |    2 +-
 gl/m4/close.m4                                     |    2 +-
 gl/m4/csharp.m4                                    |    2 +-
 gl/m4/csharpcomp.m4                                |    2 +-
 gl/m4/csharpexec.m4                                |    2 +-
 gl/m4/dup2.m4                                      |    7 +-
 gl/m4/eealloc.m4                                   |    2 +-
 gl/m4/environ.m4                                   |    2 +-
 gl/m4/errno_h.m4                                   |    2 +-
 gl/m4/error.m4                                     |    2 +-
 gl/m4/extensions.m4                                |   51 ++-
 gl/m4/extern-inline.m4                             |   19 +-
 gl/m4/fcntl-o.m4                                   |    2 +-
 gl/m4/fcntl_h.m4                                   |    2 +-
 gl/m4/fdopen.m4                                    |    2 +-
 gl/m4/fstat.m4                                     |    2 +-
 gl/m4/getcwd.m4                                    |    4 +-
 gl/m4/getdtablesize.m4                             |   17 +
 gl/m4/getopt.m4                                    |    2 +-
 gl/m4/gnulib-cache.m4                              |    2 +-
 gl/m4/gnulib-common.m4                             |    8 +-
 gl/m4/gnulib-comp.m4                               |   19 +-
 gl/m4/gnulib-tool.m4                               |    2 +-
 gl/m4/include_next.m4                              |    2 +-
 gl/m4/inttypes-pri.m4                              |    2 +-
 gl/m4/inttypes.m4                                  |    2 +-
 gl/m4/largefile.m4                                 |   25 +-
 gl/m4/longlong.m4                                  |    2 +-
 gl/m4/lstat.m4                                     |    2 +-
 gl/m4/malloc.m4                                    |    2 +-
 gl/m4/malloca.m4                                   |    2 +-
 gl/m4/manywarnings.m4                              |    8 +-
 gl/m4/mode_t.m4                                    |    2 +-
 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/open.m4                                      |    2 +-
 gl/m4/pathmax.m4                                   |    2 +-
 gl/m4/putenv.m4                                    |   10 +-
 gl/m4/setenv.m4                                    |    2 +-
 gl/m4/ssize_t.m4                                   |    2 +-
 gl/m4/stat.m4                                      |    2 +-
 gl/m4/stdarg.m4                                    |    2 +-
 gl/m4/stdbool.m4                                   |    2 +-
 gl/m4/stddef_h.m4                                  |    2 +-
 gl/m4/stdint.m4                                    |    2 +-
 gl/m4/stdio_h.m4                                   |    2 +-
 gl/m4/stdlib_h.m4                                  |    8 +-
 gl/m4/strerror.m4                                  |    2 +-
 gl/m4/string_h.m4                                  |    2 +-
 gl/m4/symlink.m4                                   |    2 +-
 gl/m4/sys_socket_h.m4                              |    2 +-
 gl/m4/sys_stat_h.m4                                |    2 +-
 gl/m4/sys_types_h.m4                               |    6 +-
 gl/m4/time_h.m4                                    |    2 +-
 gl/m4/unistd_h.m4                                  |    2 +-
 gl/m4/valgrind-tests.m4                            |    2 +-
 gl/m4/version-etc.m4                               |    2 +-
 gl/m4/warn-on-use.m4                               |    2 +-
 gl/m4/warnings.m4                                  |   17 +-
 gl/m4/wchar_h.m4                                   |    2 +-
 gl/m4/wchar_t.m4                                   |    2 +-
 gl/m4/wint_t.m4                                    |    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/stdarg.in.h                                     |    2 +-
 gl/stddef.in.h                                     |    2 +-
 gl/strerror-override.c                             |    2 +-
 gl/strerror-override.h                             |    2 +-
 gl/strerror.c                                      |    2 +-
 gl/string.in.h                                     |    2 +-
 gl/sys_types.in.h                                  |    2 +-
 gl/unistd.in.h                                     |   29 +-
 gl/verify.h                                        |    6 +-
 gl/version-etc.c                                   |    4 +-
 gl/version-etc.h                                   |    2 +-
 gltests/Makefile.am                                |   24 +-
 gltests/alloca.in.h                                |    2 +-
 gltests/binary-io.h                                |    2 +-
 gltests/close.c                                    |    2 +-
 gltests/dosname.h                                  |    2 +-
 gltests/dup2.c                                     |    5 +-
 gltests/fcntl.in.h                                 |    2 +-
 gltests/fd-hook.c                                  |    2 +-
 gltests/fd-hook.h                                  |    2 +-
 gltests/fdopen.c                                   |    2 +-
 gltests/fstat.c                                    |    2 +-
 gltests/getcwd-lgpl.c                              |    2 +-
 gltests/getdtablesize.c                            |   86 +++++
 gltests/ignore-value.h                             |    2 +-
 gltests/init.sh                                    |    2 +-
 gltests/inttypes.in.h                              |    2 +-
 gltests/lstat.c                                    |    2 +-
 gltests/macros.h                                   |    2 +-
 gltests/malloc.c                                   |    2 +-
 gltests/malloca.c                                  |   31 +-
 gltests/malloca.h                                  |    4 +-
 gltests/open.c                                     |    2 +-
 gltests/pathmax.h                                  |    2 +-
 gltests/putenv.c                                   |   98 ++++-
 gltests/same-inode.h                               |    2 +-
 gltests/setenv.c                                   |   10 +-
 gltests/signature.h                                |    2 +-
 gltests/stat.c                                     |    2 +-
 gltests/stdbool.in.h                               |    2 +-
 gltests/stdint.in.h                                |    4 +-
 gltests/stdio.c                                    |    3 -
 gltests/stdio.in.h                                 |   37 +-
 gltests/stdlib.in.h                                |   23 +-
 gltests/symlink.c                                  |    2 +-
 gltests/sys_stat.in.h                              |    6 +-
 gltests/test-alloca-opt.c                          |    2 +-
 gltests/test-binary-io.c                           |    2 +-
 gltests/test-close.c                               |    3 +-
 gltests/test-dup2.c                                |   10 +-
 gltests/test-environ.c                             |    2 +-
 gltests/test-errno.c                               |    2 +-
 gltests/test-fdopen.c                              |    4 +-
 gltests/test-fgetc.c                               |    6 +-
 gltests/test-fputc.c                               |    6 +-
 gltests/test-fread.c                               |    6 +-
 gltests/test-fstat.c                               |    4 +-
 gltests/test-fwrite.c                              |    6 +-
 gltests/test-getcwd-lgpl.c                         |    2 +-
 .../test-getdtablesize.c                           |   22 +-
 gltests/test-getopt.c                              |    2 +-
 gltests/test-getopt.h                              |    2 +-
 gltests/test-getopt_long.h                         |    2 +-
 gltests/test-ignore-value.c                        |    2 +-
 gltests/test-init.sh                               |    2 +-
 gltests/test-intprops.c                            |    2 +-
 gltests/test-inttypes.c                            |    2 +-
 gltests/test-lstat.c                               |    2 +-
 gltests/test-lstat.h                               |    2 +-
 gltests/test-malloca.c                             |    2 +-
 gltests/test-open.c                                |    2 +-
 gltests/test-open.h                                |    2 +-
 gltests/test-pathmax.c                             |    2 +-
 gltests/test-setenv.c                              |    2 +-
 gltests/test-stat.c                                |    2 +-
 gltests/test-stat.h                                |    2 +-
 gltests/test-stdbool.c                             |    2 +-
 gltests/test-stddef.c                              |    2 +-
 gltests/test-stdint.c                              |    2 +-
 gltests/test-stdio.c                               |    2 +-
 gltests/test-strerror.c                            |    2 +-
 gltests/test-symlink.c                             |    2 +-
 gltests/test-symlink.h                             |    2 +-
 gltests/test-sys_types.c                           |    2 +-
 gltests/test-unsetenv.c                            |    2 +-
 gltests/test-vc-list-files-cvs.sh                  |    2 +-
 gltests/test-vc-list-files-git.sh                  |    2 +-
 gltests/test-verify.c                              |    2 +-
 gltests/test-version-etc.c                         |    2 +-
 gltests/test-version-etc.sh                        |    2 +-
 gltests/time.in.h                                  |    2 +-
 gltests/unsetenv.c                                 |    6 +-
 gltests/version-etc-fsf.c                          |    2 +-
 gltests/wchar.in.h                                 |    2 +-
 java/Makefile.am                                   |   33 +-
 java/pom.xml.in                                    |  112 ++++++
 java/{gnu/inet => src}/Makefile.am                 |    4 +-
 java/{gnu => src/main}/Makefile.am                 |    4 +-
 java/{gnu => src/main/java}/Makefile.am            |   14 +-
 java/{ => src/main/java}/gnu/Makefile.am           |    2 +-
 java/{ => src/main/java}/gnu/inet/Makefile.am      |    2 +-
 .../java}/gnu/inet/encoding/CombiningClass.java    |    0
 .../main/java}/gnu/inet/encoding/Composition.java  |    0
 .../java}/gnu/inet/encoding/DecompositionKeys.java |    0
 .../gnu/inet/encoding/DecompositionMappings.java   |    0
 .../main/java}/gnu/inet/encoding/IDNA.java         |   14 +-
 .../java}/gnu/inet/encoding/IDNAException.java     |    2 +-
 .../main/java}/gnu/inet/encoding/Makefile.am       |    4 +-
 .../main/java}/gnu/inet/encoding/NFKC.java         |   21 +-
 .../main/java}/gnu/inet/encoding/Punycode.java     |    6 +-
 .../java}/gnu/inet/encoding/PunycodeException.java |    2 +-
 .../main/java}/gnu/inet/encoding/RFC3454.java      |    0
 java/src/main/java/gnu/inet/encoding/RangeSet.java |  404 ++++++++++++++++++++
 .../main/java}/gnu/inet/encoding/Stringprep.java   |  349 ++++++++---------
 .../gnu/inet/encoding/StringprepException.java     |    2 +-
 java/{gnu => src/test}/Makefile.am                 |    4 +-
 java/{misc => src/test/java}/Makefile.am           |   11 +-
 .../test/java/gnu/inet/encoding/RangeSetTest.java  |  190 +++++++++
 .../java/gnu/inet/encoding/StringprepTest.java     |  204 ++++++++++
 .../inet/encoding/caliper/CaliperStringprep.java   |  169 ++++++++
 java/{gnu => src/util}/Makefile.am                 |    4 +-
 java/{misc => src/util/java}/GenerateNFKC.java     |   16 +-
 java/{misc => src/util/java}/GenerateRFC3454.java  |   12 +-
 java/{misc => src/util/java}/Makefile.am           |    6 +-
 java/{misc => src/util/java}/TestIDNA.java         |    6 +-
 java/{misc => src/util/java}/TestNFKC.java         |    8 +-
 lib/Makefile.am                                    |    4 +-
 lib/gen-stringprep-tables.pl                       |    2 +-
 lib/gen-tld-tables.pl                              |    4 +-
 lib/gen-unicode-tables.pl                          |    2 +-
 lib/gl/Makefile.am                                 |    4 +-
 lib/gl/c-ctype.c                                   |    2 +-
 lib/gl/c-ctype.h                                   |    5 +-
 lib/gl/c-strcase.h                                 |    2 +-
 lib/gl/c-strcasecmp.c                              |    2 +-
 lib/gl/c-strncasecmp.c                             |    2 +-
 lib/gl/gettext.h                                   |    2 +-
 lib/gl/iconv.c                                     |    2 +-
 lib/gl/iconv.in.h                                  |    2 +-
 lib/gl/iconv_close.c                               |    2 +-
 lib/gl/iconv_open.c                                |    2 +-
 lib/gl/m4/00gnulib.m4                              |    2 +-
 lib/gl/m4/alloca.m4                                |    2 +-
 lib/gl/m4/codeset.m4                               |    2 +-
 lib/gl/m4/eealloc.m4                               |    2 +-
 lib/gl/m4/environ.m4                               |    2 +-
 lib/gl/m4/extensions.m4                            |   51 ++-
 lib/gl/m4/extern-inline.m4                         |   19 +-
 lib/gl/m4/gnulib-cache.m4                          |    2 +-
 lib/gl/m4/gnulib-common.m4                         |    8 +-
 lib/gl/m4/gnulib-comp.m4                           |    8 +-
 lib/gl/m4/gnulib-tool.m4                           |    2 +-
 lib/gl/m4/iconv.m4                                 |    2 +-
 lib/gl/m4/iconv_h.m4                               |    2 +-
 lib/gl/m4/iconv_open.m4                            |    2 +-
 lib/gl/m4/include_next.m4                          |    2 +-
 lib/gl/m4/inline.m4                                |    2 +-
 lib/gl/m4/intlmacosx.m4                            |    2 +-
 lib/gl/m4/inttypes-pri.m4                          |    2 +-
 lib/gl/m4/inttypes.m4                              |    2 +-
 lib/gl/m4/lcmessage.m4                             |    2 +-
 lib/gl/m4/ld-output-def.m4                         |    2 +-
 lib/gl/m4/ld-version-script.m4                     |    2 +-
 lib/gl/m4/lib-ld.m4                                |    2 +-
 lib/gl/m4/lib-link.m4                              |    2 +-
 lib/gl/m4/lib-prefix.m4                            |    2 +-
 lib/gl/m4/libunistring-base.m4                     |    2 +-
 lib/gl/m4/locale-fr.m4                             |    2 +-
 lib/gl/m4/locale-ja.m4                             |    2 +-
 lib/gl/m4/locale-tr.m4                             |    2 +-
 lib/gl/m4/locale-zh.m4                             |    2 +-
 lib/gl/m4/locale_h.m4                              |    2 +-
 lib/gl/m4/localename.m4                            |    2 +-
 lib/gl/m4/lock.m4                                  |    5 +-
 lib/gl/m4/longlong.m4                              |    2 +-
 lib/gl/m4/malloc.m4                                |    2 +-
 lib/gl/m4/malloca.m4                               |    2 +-
 lib/gl/m4/multiarch.m4                             |    2 +-
 lib/gl/m4/off_t.m4                                 |    2 +-
 lib/gl/m4/putenv.m4                                |   10 +-
 lib/gl/m4/setenv.m4                                |    2 +-
 lib/gl/m4/setlocale.m4                             |    2 +-
 lib/gl/m4/ssize_t.m4                               |    2 +-
 lib/gl/m4/stdbool.m4                               |    2 +-
 lib/gl/m4/stddef_h.m4                              |    2 +-
 lib/gl/m4/stdint.m4                                |    2 +-
 lib/gl/m4/stdlib_h.m4                              |    8 +-
 lib/gl/m4/string_h.m4                              |    2 +-
 lib/gl/m4/strverscmp.m4                            |    2 +-
 lib/gl/m4/sys_types_h.m4                           |    6 +-
 lib/gl/m4/thread.m4                                |    2 +-
 lib/gl/m4/threadlib.m4                             |    2 +-
 lib/gl/m4/unistd_h.m4                              |    2 +-
 lib/gl/m4/visibility.m4                            |    2 +-
 lib/gl/m4/warn-on-use.m4                           |    2 +-
 lib/gl/m4/wchar_h.m4                               |    2 +-
 lib/gl/m4/wchar_t.m4                               |    2 +-
 lib/gl/m4/wint_t.m4                                |    2 +-
 lib/gl/m4/yield.m4                                 |    2 +-
 lib/gl/stdbool.in.h                                |    2 +-
 lib/gl/stddef.in.h                                 |    2 +-
 lib/gl/stdint.in.h                                 |    4 +-
 lib/gl/striconv.c                                  |    2 +-
 lib/gl/striconv.h                                  |    2 +-
 lib/gl/string.in.h                                 |    2 +-
 lib/gl/strverscmp.c                                |    2 +-
 lib/gl/unistr.in.h                                 |    2 +-
 lib/gl/unistr/u8-mbtoucr.c                         |    2 +-
 lib/gl/unistr/u8-uctomb-aux.c                      |    2 +-
 lib/gl/unistr/u8-uctomb.c                          |    2 +-
 lib/gl/unitypes.in.h                               |    2 +-
 lib/gltests/Makefile.am                            |    6 +-
 lib/gltests/alloca.in.h                            |    2 +-
 lib/gltests/glthread/lock.c                        |    2 +-
 lib/gltests/glthread/lock.h                        |    2 +-
 lib/gltests/glthread/thread.c                      |    2 +-
 lib/gltests/glthread/thread.h                      |    8 +-
 lib/gltests/glthread/threadlib.c                   |    2 +-
 lib/gltests/glthread/yield.h                       |    2 +-
 lib/gltests/init.sh                                |    2 +-
 lib/gltests/intprops.h                             |    4 +-
 lib/gltests/inttypes.in.h                          |    2 +-
 lib/gltests/locale.in.h                            |   21 +-
 lib/gltests/localename.c                           |    2 +-
 lib/gltests/localename.h                           |    2 +-
 lib/gltests/macros.h                               |    2 +-
 lib/gltests/malloc.c                               |    2 +-
 lib/gltests/malloca.c                              |   31 +-
 lib/gltests/malloca.h                              |    4 +-
 lib/gltests/putenv.c                               |   98 ++++-
 lib/gltests/setenv.c                               |   10 +-
 lib/gltests/setlocale.c                            |    2 +-
 lib/gltests/signature.h                            |    2 +-
 lib/gltests/stdlib.in.h                            |   23 +-
 lib/gltests/sys_types.in.h                         |    2 +-
 lib/gltests/test-alloca-opt.c                      |    2 +-
 lib/gltests/test-c-ctype.c                         |    2 +-
 lib/gltests/test-c-strcasecmp.c                    |    2 +-
 lib/gltests/test-c-strncasecmp.c                   |    2 +-
 lib/gltests/test-environ.c                         |    2 +-
 lib/gltests/test-iconv.c                           |    2 +-
 lib/gltests/test-init.sh                           |    2 +-
 lib/gltests/test-intprops.c                        |    2 +-
 lib/gltests/test-inttypes.c                        |    2 +-
 lib/gltests/test-locale.c                          |    2 +-
 lib/gltests/test-localename.c                      |    2 +-
 lib/gltests/test-lock.c                            |    2 +-
 lib/gltests/test-malloca.c                         |    2 +-
 lib/gltests/test-setenv.c                          |    2 +-
 lib/gltests/test-setlocale1.c                      |    2 +-
 lib/gltests/test-setlocale2.c                      |    2 +-
 lib/gltests/test-stdbool.c                         |    2 +-
 lib/gltests/test-stddef.c                          |    2 +-
 lib/gltests/test-stdint.c                          |    2 +-
 lib/gltests/test-stdlib.c                          |    2 +-
 lib/gltests/test-striconv.c                        |    2 +-
 lib/gltests/test-strverscmp.c                      |    2 +-
 lib/gltests/test-sys_types.c                       |    2 +-
 lib/gltests/test-sys_wait.h                        |    2 +-
 lib/gltests/test-thread_create.c                   |    2 +-
 lib/gltests/test-thread_self.c                     |    2 +-
 lib/gltests/test-unistd.c                          |    2 +-
 lib/gltests/test-unsetenv.c                        |    2 +-
 lib/gltests/test-verify.c                          |    2 +-
 lib/gltests/unistd.in.h                            |   29 +-
 lib/gltests/unistr/test-u8-mbtoucr.c               |    2 +-
 lib/gltests/unistr/test-u8-uctomb.c                |    2 +-
 lib/gltests/unsetenv.c                             |    6 +-
 lib/gltests/verify.h                               |    6 +-
 lib/gltests/wchar.in.h                             |    2 +-
 lib/idn-free.c                                     |    2 +-
 lib/idn-free.h                                     |    2 +-
 lib/idna.c                                         |    2 +-
 lib/idna.h                                         |    2 +-
 lib/libidn.map                                     |    2 +-
 lib/nfkc.c                                         |    2 +-
 lib/pr29.c                                         |    2 +-
 lib/pr29.h                                         |    2 +-
 lib/profiles.c                                     |    2 +-
 lib/punycode.c                                     |    2 +-
 lib/punycode.h                                     |    2 +-
 lib/strerror-idna.c                                |    2 +-
 lib/strerror-pr29.c                                |    2 +-
 lib/strerror-punycode.c                            |    2 +-
 lib/strerror-stringprep.c                          |    2 +-
 lib/strerror-tld.c                                 |    2 +-
 lib/stringprep.c                                   |    2 +-
 lib/stringprep.h                                   |    2 +-
 lib/tld.c                                          |    4 +-
 lib/tld.h                                          |    4 +-
 lib/toutf8.c                                       |    2 +-
 lib/version.c                                      |    2 +-
 libc/README                                        |    2 +-
 libc/example.c                                     |    2 +-
 libc/getaddrinfo-idn.txt                           |    2 +-
 libidn.pc.in                                       |    2 +-
 m4/update-header-version.m4                        |    2 +-
 maint.mk                                           |   10 +-
 po/eo.po.in                                        |  280 +++++++-------
 pom.xml.in                                         |   44 ---
 src/Makefile.am                                    |    2 +-
 src/idn.c                                          |    4 +-
 src/idn.ggo                                        |    2 +-
 src/idna.el                                        |    2 +-
 src/punycode.el                                    |    2 +-
 tests/Makefile.am                                  |    2 +-
 tests/libidn.supp                                  |    2 +-
 tests/tst_idna.c                                   |    2 +-
 tests/tst_idna2.c                                  |    2 +-
 tests/tst_idna3.c                                  |    2 +-
 tests/tst_idna4.c                                  |    2 +-
 tests/tst_nfkc.c                                   |    2 +-
 tests/tst_pr29.c                                   |    2 +-
 tests/tst_punycode.c                               |    2 +-
 tests/tst_strerror.c                               |    2 +-
 tests/tst_stringprep.c                             |    2 +-
 tests/tst_symbols.c                                |    2 +-
 tests/tst_tld.c                                    |    2 +-
 tests/tst_toutf8.c                                 |    2 +-
 tests/utils.c                                      |    2 +-
 tests/utils.h                                      |    2 +-
 windows/include/ac-stdint.h                        |    2 +-
 windows/include/config.h                           |    2 +-
 windows/include/idn-int.h                          |    2 +-
 windows/include/stdbool.h                          |    2 +-
 windows/libidn4win.mk                              |    2 +-
 473 files changed, 2764 insertions(+), 1266 deletions(-)
 create mode 100644 gl/m4/getdtablesize.m4
 create mode 100644 gltests/getdtablesize.c
 delete mode 100644 gltests/stdio.c
 copy lib/gltests/test-sys_types.c => gltests/test-getdtablesize.c (67%)
 create mode 100644 java/pom.xml.in
 copy java/{gnu/inet => src}/Makefile.am (91%)
 copy java/{gnu => src/main}/Makefile.am (92%)
 copy java/{gnu => src/main/java}/Makefile.am (75%)
 copy java/{ => src/main/java}/gnu/Makefile.am (94%)
 rename java/{ => src/main/java}/gnu/inet/Makefile.am (94%)
 rename java/{ => src/main/java}/gnu/inet/encoding/CombiningClass.java (100%)
 rename java/{ => src/main/java}/gnu/inet/encoding/Composition.java (100%)
 rename java/{ => src/main/java}/gnu/inet/encoding/DecompositionKeys.java (100%)
 rename java/{ => src/main/java}/gnu/inet/encoding/DecompositionMappings.java 
(100%)
 rename java/{ => src/main/java}/gnu/inet/encoding/IDNA.java (96%)
 rename java/{ => src/main/java}/gnu/inet/encoding/IDNAException.java (96%)
 rename java/{ => src/main/java}/gnu/inet/encoding/Makefile.am (92%)
 rename java/{ => src/main/java}/gnu/inet/encoding/NFKC.java (94%)
 rename java/{ => src/main/java}/gnu/inet/encoding/Punycode.java (97%)
 rename java/{ => src/main/java}/gnu/inet/encoding/PunycodeException.java (95%)
 rename java/{ => src/main/java}/gnu/inet/encoding/RFC3454.java (100%)
 create mode 100644 java/src/main/java/gnu/inet/encoding/RangeSet.java
 rename java/{ => src/main/java}/gnu/inet/encoding/Stringprep.java (55%)
 rename java/{ => src/main/java}/gnu/inet/encoding/StringprepException.java 
(96%)
 copy java/{gnu => src/test}/Makefile.am (92%)
 copy java/{misc => src/test/java}/Makefile.am (82%)
 create mode 100644 java/src/test/java/gnu/inet/encoding/RangeSetTest.java
 create mode 100644 java/src/test/java/gnu/inet/encoding/StringprepTest.java
 create mode 100644 
java/src/test/java/gnu/inet/encoding/caliper/CaliperStringprep.java
 rename java/{gnu => src/util}/Makefile.am (92%)
 rename java/{misc => src/util/java}/GenerateNFKC.java (97%)
 rename java/{misc => src/util/java}/GenerateRFC3454.java (96%)
 rename java/{misc => src/util/java}/Makefile.am (80%)
 rename java/{misc => src/util/java}/TestIDNA.java (96%)
 rename java/{misc => src/util/java}/TestNFKC.java (95%)
 delete mode 100644 pom.xml.in

diff --git a/.clcopying b/.clcopying
index 6ea102c..7e45b47 100644
--- a/.clcopying
+++ b/.clcopying
@@ -1,6 +1,6 @@
        -----
 
-       Copyright (C) 2002-2012 Simon Josefsson
+       Copyright (C) 2002-2013 Simon Josefsson
 
        Copying and distribution of this file, with or without
        modification, are permitted provided the copyright notice
diff --git a/.gitignore b/.gitignore
index 5d00fd9..04fb630 100644
--- a/.gitignore
+++ b/.gitignore
@@ -255,38 +255,32 @@ gltests/time.h
 gltests/version-etc-fsf.o
 gltests/warn-on-use.h
 gltests/wchar.h
-java/Makefile
-java/Makefile.in
-java/gnu/Makefile
-java/gnu/Makefile.in
-java/gnu/inet/Makefile
-java/gnu/inet/Makefile.in
-java/gnu/inet/encoding/CombiningClass.class
-java/gnu/inet/encoding/Composition.class
-java/gnu/inet/encoding/DecompositionKeys.class
-java/gnu/inet/encoding/DecompositionMappings.class
-java/gnu/inet/encoding/IDNA.class
-java/gnu/inet/encoding/IDNAException.class
-java/gnu/inet/encoding/Makefile
-java/gnu/inet/encoding/Makefile.in
-java/gnu/inet/encoding/NFKC.class
-java/gnu/inet/encoding/Punycode.class
-java/gnu/inet/encoding/PunycodeException.class
-java/gnu/inet/encoding/RFC3454.class
-java/gnu/inet/encoding/Stringprep.class
-java/gnu/inet/encoding/StringprepException.class
-java/gnu/inet/encoding/classdist_noinst.stamp
-java/gnu/inet/encoding/classnoinst.stamp
 java/libidn-*.jar
-java/misc/GenerateNFKC.class
-java/misc/GenerateRFC3454$Range.class
-java/misc/GenerateRFC3454.class
-java/misc/Makefile
-java/misc/Makefile.in
-java/misc/TestIDNA.class
-java/misc/TestNFKC.class
-java/misc/classdist_noinst.stamp
-java/misc/classnoinst.stamp
+java/src/main/java/gnu/inet/encoding/CombiningClass.class
+java/src/main/java/gnu/inet/encoding/Composition.class
+java/src/main/java/gnu/inet/encoding/DecompositionKeys.class
+java/src/main/java/gnu/inet/encoding/DecompositionMappings.class
+java/src/main/java/gnu/inet/encoding/IDNA.class
+java/src/main/java/gnu/inet/encoding/IDNAException.class
+java/src/main/java/gnu/inet/encoding/NFKC.class
+java/src/main/java/gnu/inet/encoding/Punycode.class
+java/src/main/java/gnu/inet/encoding/PunycodeException.class
+java/src/main/java/gnu/inet/encoding/RFC3454.class
+java/src/main/java/gnu/inet/encoding/RangeSet$1.class
+java/src/main/java/gnu/inet/encoding/RangeSet$Builder.class
+java/src/main/java/gnu/inet/encoding/RangeSet$Range.class
+java/src/main/java/gnu/inet/encoding/RangeSet$RangeContainsComparator.class
+java/src/main/java/gnu/inet/encoding/RangeSet.class
+java/src/main/java/gnu/inet/encoding/Stringprep.class
+java/src/main/java/gnu/inet/encoding/StringprepException.class
+java/src/main/java/gnu/inet/encoding/classnoinst.stamp
+java/src/util/java/GenerateNFKC.class
+java/src/util/java/GenerateRFC3454$Range.class
+java/src/util/java/GenerateRFC3454.class
+java/src/util/java/TestIDNA.class
+java/src/util/java/TestNFKC.class
+java/src/util/java/classnoinst.stamp
+java/target
 lib/.deps/
 lib/.libs/
 lib/Makefile
diff --git a/AUTHORS b/AUTHORS
index b2dd876..7d99b95 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,5 @@
 Libidn AUTHORS -- Information about the authors.
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
 Simon Josefsson <address@hidden>
@@ -11,6 +11,9 @@ Contributed TLD support.
 Oliver Hitz <address@hidden>
 Contributed Java implementation.
 
+Stefan Larsson <address@hidden>
+Optimized Java implementation.  Added Maven support.
+
 Alexander Gnauck <address@hidden>
 Contributed C# port.
 
diff --git a/COPYING b/COPYING
index 43418dd..f67abb1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,5 +1,5 @@
 Libidn COPYING -- Explanation of licensing conditions.
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
 The source code for the C library (libidn.a or libidn.so), the C#
diff --git a/FAQ b/FAQ
index e3b1f27..06377dc 100644
--- a/FAQ
+++ b/FAQ
@@ -1,5 +1,5 @@
 Libidn FAQ -- Anticipated Frequently Asked Questions.
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
 Q#1: Why doesn't Libidn use a separate library for the Unicode
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/HACKING b/HACKING
index 8dccbf2..f395ee9 100644
--- a/HACKING
+++ b/HACKING
@@ -1,5 +1,5 @@
 Libidn HACKING -- Information for contributors.                 -*- outline -*-
-Copyright (C) 2009-2012 Simon Josefsson
+Copyright (C) 2009-2013 Simon Josefsson
 See the end for copying conditions.
 
 This file contains instructions for developers and advanced users that
diff --git a/Makefile.am b/Makefile.am
index b25ddbe..973188e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Simon Josefsson
+# Copyright (C) 2002-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/NEWS b/NEWS
index f35b407..b85359a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,14 @@
 Libidn NEWS -- History of user-visible changes.                 -*- outline -*-
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
-* Version 1.27 (unreleased) [stable]
+* Version 1.27 (released 2013-06-05) [stable]
+
+** Java library can be built using Maven.  Speed improvements.
+Thanks to several patches from Stefan Larsson.  Testing indicate 70-90
+times faster node/name/resource-prep.
+
+** Update gnulib files and translations.
 
 ** API and ABI is backwards compatible with the previous version.
 
diff --git a/README b/README
index d71461e..007166c 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 Libidn README -- Important introductory notes.
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
 Libidn is a package for internationalized string handling based on the
diff --git a/THANKS b/THANKS
index 0b437ea..baef92f 100644
--- a/THANKS
+++ b/THANKS
@@ -1,5 +1,5 @@
 Libidn THANKS -- Acknowledgements.
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
 The punycode code was taken from the IETF IDN Punycode specification,
diff --git a/TODO b/TODO
index 19badba..e2010f2 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,5 @@
 Libidn TODO -- Future directions.
-Copyright (C) 2002-2012 Simon Josefsson
+Copyright (C) 2002-2013 Simon Josefsson
 See the end for copying conditions.
 
 If you like to start working on anything, please let me know so work
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index 1a07018..c38b914 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2012 Free Software Foundation, Inc.
+#   Copyright 1996-2013 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <address@hidden>, 1996
 #
diff --git a/build-aux/csharpcomp.sh.in b/build-aux/csharpcomp.sh.in
index b51ab30..7e02c1d 100644
--- a/build-aux/csharpcomp.sh.in
+++ b/build-aux/csharpcomp.sh.in
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Compile a C# program.
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 # Written by Bruno Haible <address@hidden>, 2003.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/build-aux/csharpexec.sh.in b/build-aux/csharpexec.sh.in
index 98c2537..19dff73 100644
--- a/build-aux/csharpexec.sh.in
+++ b/build-aux/csharpexec.sh.in
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Execute a C# program.
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 # Written by Bruno Haible <address@hidden>, 2003.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 0c0bc4b..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-10-27.11
+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
@@ -56,7 +56,7 @@ 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."
@@ -69,16 +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/.
-  -I DIR      append DIR to the Texinfo search path.
-  --email ADR use ADR as contact in generated web pages.
-  --docbook   convert through DocBook too (xml, txt, html, pdf).
-  --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\"
 
@@ -92,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
@@ -117,7 +124,7 @@ 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, 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
@@ -130,25 +137,34 @@ Email bug reports or enhancement requests to 
address@hidden
 MANUAL_TITLE=
 PACKAGE=
 address@hidden  # please override with --email
-commonarg= # Options passed to all the tools (-I dir).
+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;;
-    -I) shift; commonarg="$commonarg -I '$1'"; dirs="$dirs $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
@@ -166,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
 
@@ -247,46 +266,53 @@ case $outdir in
   *)  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 $commonarg $infoarg \"$srcfile\""
-echo "Generating info file(s)... ($cmd)"
+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 $commonarg \"$srcfile\""
-echo "Generating dvi ... ($cmd)"
+cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\""
+printf "\nGenerating dvi... ($cmd)\n"
 eval "$cmd"
-
 # 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 $commonarg \"$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"
 
-opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
-cmd="$SETLANG $MAKEINFO $opt \"$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 $commonarg $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
   (
@@ -304,7 +330,7 @@ html_split()
 if test -z "$use_texi2html"; then
   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`
@@ -312,24 +338,38 @@ if test -z "$use_texi2html"; then
   html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
   copy_images "$outdir/" $PACKAGE.html
   mv $PACKAGE.html "$outdir/"
-
-  opt="--html -o $PACKAGE.html $commonarg $htmlarg"
+  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\""
-  echo "Generating html by node... ($cmd)"
+  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" -- *
+    tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- *
   )
-  html_node_tgz_size=`calcsize "$outdir/$PACKAGE.html_node.tar.gz"`
-  rm -rf "$outdir/html_node/"
-  mv $split_html_dir "$outdir/html_node/"
-else
+  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\""
-  echo "Generating monolithic html... ($cmd)"
+  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`
@@ -342,19 +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
   opt="-o - --docbook $commonarg"
   cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
-  echo "Generating docbook XML... ($cmd)"
+  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"
@@ -364,7 +405,7 @@ if test -n "$docbook"; then
   split_html_db_dir=html_node_db
   opt="$commonarg -o $split_html_db_dir"
   cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook HTML... ($cmd)"
+  printf "\nGenerating docbook HTML... ($cmd)\n"
   eval "$cmd"
   (
     cd ${split_html_db_dir} || exit 1
@@ -377,24 +418,25 @@ if test -n "$docbook"; then
   rmdir ${split_html_db_dir}
 
   cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook ASCII... ($cmd)"
+  printf "\nGenerating docbook ASCII... ($cmd)\n"
   eval "$cmd"
   docbook_ascii_size=`calcsize $PACKAGE-db.txt`
   mv $PACKAGE-db.txt "$outdir/"
 
   cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\""
-  echo "Generating docbook PDF... ($cmd)"
+  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'`
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 6eecef4..7a137c1 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2012-12-11.16; # 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
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/snippet/arg-nonnull.h b/build-aux/snippet/arg-nonnull.h
index 3a9dd26..8ea2a47 100644
--- a/build-aux/snippet/arg-nonnull.h
+++ b/build-aux/snippet/arg-nonnull.h
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
-   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
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
index 96da94b..b35b933 100644
--- a/build-aux/snippet/c++defs.h
+++ b/build-aux/snippet/c++defs.h
@@ -1,5 +1,5 @@
 /* C++ compatible function declaration macros.
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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
diff --git a/build-aux/snippet/unused-parameter.h 
b/build-aux/snippet/unused-parameter.h
index 1c8d61f..1347c27 100644
--- a/build-aux/snippet/unused-parameter.h
+++ b/build-aux/snippet/unused-parameter.h
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific function parameters are not used.
-   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
diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h
index 51e69bb..1736a1b 100644
--- a/build-aux/snippet/warn-on-use.h
+++ b/build-aux/snippet/warn-on-use.h
@@ -1,5 +1,5 @@
 /* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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
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 db1f9c8..d34d7d3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2012 Simon Josefsson
+# Copyright (C) 2006-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/configure.ac b/configure.ac
index cff0075..8046710 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-dnl Copyright (C) 2002-2012 Simon Josefsson
+dnl Copyright (C) 2002-2013 Simon Josefsson
 dnl
 dnl This file is part of GNU Libidn.
 dnl
@@ -19,7 +19,6 @@ dnl along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 
 AC_PREREQ(2.61)
 AC_INIT([GNU Libidn], [1.27], address@hidden)
-AC_COPYRIGHT([Copyright (c) 2002-2012 Simon Josefsson <address@hidden>.])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
@@ -174,16 +173,22 @@ AC_CONFIG_FILES([
   gl/Makefile
   gltests/Makefile
   java/Makefile
-  java/gnu/Makefile
-  java/gnu/inet/Makefile
-  java/gnu/inet/encoding/Makefile
-  java/misc/Makefile
+  java/pom.xml
+  java/src/Makefile
+  java/src/main/Makefile
+  java/src/main/java/Makefile
+  java/src/main/java/gnu/Makefile
+  java/src/main/java/gnu/inet/Makefile
+  java/src/main/java/gnu/inet/encoding/Makefile
+  java/src/util/Makefile
+  java/src/util/java/Makefile
+  java/src/test/Makefile
+  java/src/test/java/Makefile
   lib/Makefile
   lib/gl/Makefile
   lib/gltests/Makefile
   libidn.pc
   po/Makefile.in
-  pom.xml
   src/Makefile
   tests/Makefile
 ])
diff --git a/contrib/README b/contrib/README
index f03b7e0..8479288 100644
--- a/contrib/README
+++ b/contrib/README
@@ -1,5 +1,5 @@
 Libidn contrib/README -- Notes for the contrib/ subdirectory.
-Copyright (C) 2003-2012 Simon Josefsson
+Copyright (C) 2003-2013 Simon Josefsson
 See the end for copying conditions.
 
 The idn-python/ sub-directory contains a Python interface for Libidn,
diff --git a/contrib/doxygen/gdoc2doxygen b/contrib/doxygen/gdoc2doxygen
index da6e3f9..2440b82 100755
--- a/contrib/doxygen/gdoc2doxygen
+++ b/contrib/doxygen/gdoc2doxygen
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# Copyright (C) 2003-2012 Simon Josefsson
+# Copyright (C) 2003-2013 Simon Josefsson
 
 # 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/contrib/java/Makefile.am b/contrib/java/Makefile.am
index 6115dd4..4c9148c 100644
--- a/contrib/java/Makefile.am
+++ b/contrib/java/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Simon Josefsson.
+# Copyright (C) 2002-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/contrib/java/README b/contrib/java/README
index 2bb8e16..8d06335 100644
--- a/contrib/java/README
+++ b/contrib/java/README
@@ -1,5 +1,5 @@
 Libidn README -- Notes for the JAVA API proof of concept.
-Copyright (C) 2003-2012 Simon Josefsson
+Copyright (C) 2003-2013 Simon Josefsson
 See the end for copying conditions.
 
 This directory builds Java *.class files that implement the Libidn
diff --git a/csharp/AssemblyInfo.cs b/csharp/AssemblyInfo.cs
index 5e14dd9..f0118e1 100644
--- a/csharp/AssemblyInfo.cs
+++ b/csharp/AssemblyInfo.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/IDNA.cs b/csharp/IDNA.cs
index 47e999a..f2fe31b6 100644
--- a/csharp/IDNA.cs
+++ b/csharp/IDNA.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/IDNAException.cs b/csharp/IDNAException.cs
index 2a1a6a5..eb32746 100644
--- a/csharp/IDNAException.cs
+++ b/csharp/IDNAException.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/Makefile.am b/csharp/Makefile.am
index e1d2f74..8be8ce5 100644
--- a/csharp/Makefile.am
+++ b/csharp/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2005-2012 Simon Josefsson.
+# Copyright (C) 2005-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/csharp/NFKC.cs b/csharp/NFKC.cs
index 5ad4fb0..8226d86 100644
--- a/csharp/NFKC.cs
+++ b/csharp/NFKC.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/Punycode.cs b/csharp/Punycode.cs
index 3595088..2c1e7d6 100644
--- a/csharp/Punycode.cs
+++ b/csharp/Punycode.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/PunycodeException.cs b/csharp/PunycodeException.cs
index 371fc13..b8a4744 100644
--- a/csharp/PunycodeException.cs
+++ b/csharp/PunycodeException.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/Stringprep.cs b/csharp/Stringprep.cs
index b87647b..9e5046f 100644
--- a/csharp/Stringprep.cs
+++ b/csharp/Stringprep.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/StringprepException.cs b/csharp/StringprepException.cs
index a1b0e31..54155c0 100644
--- a/csharp/StringprepException.cs
+++ b/csharp/StringprepException.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/generate/AssemblyInfo.cs b/csharp/generate/AssemblyInfo.cs
index 956476d..2793526 100644
--- a/csharp/generate/AssemblyInfo.cs
+++ b/csharp/generate/AssemblyInfo.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/generate/GenerateNFKC.cs b/csharp/generate/GenerateNFKC.cs
index e7d321f..841c6d9 100644
--- a/csharp/generate/GenerateNFKC.cs
+++ b/csharp/generate/GenerateNFKC.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/generate/GenerateRFC3454.cs 
b/csharp/generate/GenerateRFC3454.cs
index dffab70..a21f2a3 100644
--- a/csharp/generate/GenerateRFC3454.cs
+++ b/csharp/generate/GenerateRFC3454.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/generate/HashSet.cs b/csharp/generate/HashSet.cs
index 28e1e04..c3df29d 100644
--- a/csharp/generate/HashSet.cs
+++ b/csharp/generate/HashSet.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/generate/Program.cs b/csharp/generate/Program.cs
index ee369f4..1b0bf1b 100644
--- a/csharp/generate/Program.cs
+++ b/csharp/generate/Program.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/csharp/generate/Tokenizer.cs b/csharp/generate/Tokenizer.cs
index 1ed2ae2..a6c5681 100644
--- a/csharp/generate/Tokenizer.cs
+++ b/csharp/generate/Tokenizer.cs
@@ -1,5 +1,5 @@
 /// <summary>
-/// Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/// Copyright (C) 2004-2013 Free Software Foundation, Inc.
 ///
 /// Author: Alexander Gnauck AG-Software, mailto:address@hidden
 ///
diff --git a/doc/Makefile.am b/doc/Makefile.am
index b99c5e7..7c1d700 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 Simon Josefsson.
+# Copyright (C) 2002-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
@@ -75,6 +75,6 @@ GDOC_MAN_PREFIX = man/
 GDOC_MAN_EXTRA_ARGS = -module $(PACKAGE) -sourceversion $(VERSION) \
        -bugsto $(PACKAGE_BUGREPORT) -pkg-name "$(PACKAGE_NAME)" \
        -includefuncprefix -seeinfo $(PACKAGE) \
-       -copyright "2002-2012 Simon Josefsson" \
+       -copyright "2002-2013 Simon Josefsson" \
        -verbatimcopying
 include $(srcdir)/gdoc.mk
diff --git a/doc/cyclo/Makefile.am b/doc/cyclo/Makefile.am
index 21dc67f..65e550e 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) 2008-2012 Simon Josefsson.
+# Copyright (C) 2008-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/doc/gdoc b/doc/gdoc
index 5012c3c..ef94354 100755
--- a/doc/gdoc
+++ b/doc/gdoc
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -S "$0" ${1+"$@"}'
     if 0;
 # Generate documentation from source code.
 
-## Copyright (c) 2002-2012 Simon Josefsson
+## Copyright (c) 2002-2013 Simon Josefsson
 ##                    added -texinfo, -listfunc, -pkg-name
 ##                    man page revamp
 ##                    various improvements
diff --git a/doc/gdoc.mk b/doc/gdoc.mk
index 3d67714..ea20d0e 100644
--- a/doc/gdoc.mk
+++ b/doc/gdoc.mk
@@ -1,5 +1,5 @@
 # -*- makefile -*-
-# Copyright (C) 2002-2012 Simon Josefsson
+# Copyright (C) 2002-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/doc/gendocs_template b/doc/gendocs_template
index e58e939..5b760c6 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -97,7 +97,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/java/Makefile.am b/doc/java/Makefile.am
index d4b5b2c..95951e8 100644
--- a/doc/java/Makefile.am
+++ b/doc/java/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -37,8 +37,8 @@ EXTRA_DIST = $(HTML)
 
 all-local: $(HTML)
 
-$(HTML): $(top_srcdir)/java/gnu/inet/encoding/*.java
-       cd ../../java && make javadoc
+$(HTML): $(top_srcdir)/java/src/main/java/gnu/inet/encoding/*.java
+       cd ../../java/src/main/java && make javadoc
 
 clean-local:
        rm -f $(HTML)
diff --git a/doc/libidn.texi b/doc/libidn.texi
index 79ea7a0..37ded9b 100644
--- a/doc/libidn.texi
+++ b/doc/libidn.texi
@@ -14,7 +14,7 @@
 This manual is last updated @value{UPDATED} for version
 @value{VERSION} of GNU Libidn.
 
-Copyright @copyright{} 2002-2012 Simon Josefsson.
+Copyright @copyright{} 2002-2013 Simon Josefsson.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
diff --git a/doc/tld/Makefile.am b/doc/tld/Makefile.am
index 5a3b1ae..4a13ad9 100644
--- a/doc/tld/Makefile.am
+++ b/doc/tld/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson.
+# Copyright (C) 2004-2013 Simon Josefsson.
 # Copyright (C) 2004  Free Software Foundation, Inc
 #
 # This file is part of GNU Libidn.
diff --git a/doc/tld/README b/doc/tld/README
index 4e76040..8c6f925 100644
--- a/doc/tld/README
+++ b/doc/tld/README
@@ -1,5 +1,5 @@
 Libidn doc/tld/README -- Notes and definition of the TLD tables.
-Copyright (C) 2004-2012 Simon Josefsson
+Copyright (C) 2004-2013 Simon Josefsson
 Copyright (C) 2004  Free Software Foundation, Inc
 See the end for copying conditions.
 
diff --git a/doc/tld/fr.tld b/doc/tld/fr.tld
index c724f46..daf5616 100644
--- a/doc/tld/fr.tld
+++ b/doc/tld/fr.tld
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 # Copyright (C) 2003 Stephane Bortzmeyer <address@hidden> / AFNIC
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
diff --git a/doc/tld/no.tld b/doc/tld/no.tld
index 6ee80b3..3aaf81e 100644
--- a/doc/tld/no.tld
+++ b/doc/tld/no.tld
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 # Author: Thomas Jacob, Internet24.de.
 
 # Copying and distribution of this file, with or without modification,
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 31a79d2..2c13406 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 Simon Josefsson.
+# Copyright (C) 2002-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/examples/README b/examples/README
index 7d772bd..9288644 100644
--- a/examples/README
+++ b/examples/README
@@ -1,5 +1,5 @@
 Libidn examples/README -- Information about files in examples/ directory.
-Copyright (C) 2003-2012 Simon Josefsson
+Copyright (C) 2003-2013 Simon Josefsson
 See the end for copying conditions.
 
 This directory contains examples on how to use Libidn.
diff --git a/examples/example.c b/examples/example.c
index 9034a96..561c564 100644
--- a/examples/example.c
+++ b/examples/example.c
@@ -1,5 +1,5 @@
 /* example.c --- Example code showing how to use stringprep().
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
@@ -53,7 +53,7 @@ main (void)
     perror ("fgets");
   buf[strlen (buf) - 1] = '\0';
 
-  printf ("Before locale2utf8 (length %ld): ", strlen (buf));
+  printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf));
   for (i = 0; i < strlen (buf); i++)
     printf ("%02x ", buf[i] & 0xFF);
   printf ("\n");
@@ -67,7 +67,7 @@ main (void)
   else
     printf ("Could not convert string to UTF-8, continuing anyway...\n");
 
-  printf ("Before stringprep (length %ld): ", strlen (buf));
+  printf ("Before stringprep (length %ld): ", (long int) strlen (buf));
   for (i = 0; i < strlen (buf); i++)
     printf ("%02x ", buf[i] & 0xFF);
   printf ("\n");
@@ -77,7 +77,7 @@ main (void)
     printf ("Stringprep failed (%d): %s\n", rc, stringprep_strerror (rc));
   else
     {
-      printf ("After stringprep (length %ld): ", strlen (buf));
+      printf ("After stringprep (length %ld): ", (long int) strlen (buf));
       for (i = 0; i < strlen (buf); i++)
        printf ("%02x ", buf[i] & 0xFF);
       printf ("\n");
diff --git a/examples/example2.c b/examples/example2.c
index 24fa844..83ede4e 100644
--- a/examples/example2.c
+++ b/examples/example2.c
@@ -1,5 +1,5 @@
 /* example2.c --- Example code showing how to use punycode.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  * Copyright (C) 2002  Adam M. Costello
  *
  * This file is part of GNU Libidn.
diff --git a/examples/example3.c b/examples/example3.c
index 71b0380..3c77f30 100644
--- a/examples/example3.c
+++ b/examples/example3.c
@@ -1,5 +1,5 @@
 /* example3.c --- Example ToASCII() code showing how to use Libidn.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
@@ -54,7 +54,7 @@ main (void)
     perror ("fgets");
   buf[strlen (buf) - 1] = '\0';
 
-  printf ("Read string (length %ld): ", strlen (buf));
+  printf ("Read string (length %ld): ", (long int) strlen (buf));
   for (i = 0; i < strlen (buf); i++)
     printf ("%02x ", buf[i] & 0xFF);
   printf ("\n");
@@ -66,7 +66,7 @@ main (void)
       return EXIT_FAILURE;
     }
 
-  printf ("ACE label (length %ld): '%s'\n", strlen (p), p);
+  printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
   for (i = 0; i < strlen (p); i++)
     printf ("%02x ", p[i] & 0xFF);
   printf ("\n");
diff --git a/examples/example4.c b/examples/example4.c
index 2ce9739..8d50613 100644
--- a/examples/example4.c
+++ b/examples/example4.c
@@ -1,5 +1,5 @@
 /* example4.c --- Example ToUnicode() code showing how to use Libidn.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
@@ -54,7 +54,7 @@ main (void)
     perror ("fgets");
   buf[strlen (buf) - 1] = '\0';
 
-  printf ("Read string (length %ld): ", strlen (buf));
+  printf ("Read string (length %ld): ", (long int) strlen (buf));
   for (i = 0; i < strlen (buf); i++)
     printf ("%02x ", buf[i] & 0xFF);
   printf ("\n");
@@ -66,7 +66,7 @@ main (void)
       return EXIT_FAILURE;
     }
 
-  printf ("ACE label (length %ld): '%s'\n", strlen (p), p);
+  printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
   for (i = 0; i < strlen (p); i++)
     printf ("%02x ", p[i] & 0xFF);
   printf ("\n");
diff --git a/examples/example5.c b/examples/example5.c
index 90e5ecf..78665f7 100644
--- a/examples/example5.c
+++ b/examples/example5.c
@@ -1,5 +1,5 @@
 /* example5.c --- Example TLD checking.
- * Copyright (C) 2004-2012 Simon Josefsson
+ * Copyright (C) 2004-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
@@ -66,7 +66,7 @@ main (void)
     perror ("fgets");
   buf[strlen (buf) - 1] = '\0';
 
-  printf ("Read string (length %ld): ", strlen (buf));
+  printf ("Read string (length %ld): ", (long int) strlen (buf));
   for (i = 0; i < strlen (buf); i++)
     printf ("%02x ", buf[i] & 0xFF);
   printf ("\n");
@@ -87,7 +87,7 @@ main (void)
       return 2;
     }
 
-  printf ("ToASCII string (length %ld): %s\n", strlen (p), p);
+  printf ("ToASCII string (length %ld): %s\n", (long int) strlen (p), p);
 
   rc = idna_to_unicode_8z4z (p, &r, 0);
   free (p);
@@ -107,7 +107,7 @@ main (void)
   free (r);
   if (rc == TLD_INVALID)
     {
-      printf ("Domain rejected by TLD check, Unicode position %ld\n", errpos);
+      printf ("Domain rejected by TLD check, Unicode position %ld\n", (long 
int) errpos);
       return 1;
     }
   else if (rc != TLD_SUCCESS)
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 2b3422a..5df6938 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
@@ -23,7 +23,7 @@
 # Generated by gnulib-tool.
 # Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=build-aux --with-tests --avoid=fcntl-h-tests 
--avoid=stdlib-tests --avoid=string-tests --avoid=sys_stat-tests 
--avoid=time-tests --avoid=unistd-tests --avoid=update-copyright-tests 
--avoid=wchar-tests --no-conditional-dependencies --libtool --macro-prefix=gl 
--no-vc-files autobuild csharpcomp-script csharpexec-script error fdl-1.3 
gendocs getopt-gnu gnupload maintainer-makefile manywarnings pmccabe2html 
progname update-copyright useless-if-before-free valgrind-tests vc-list-files 
version-etc warnings
 
-AUTOMAKE_OPTIONS = 1.5 gnits
+AUTOMAKE_OPTIONS = 1.9.6 gnits
 
 SUBDIRS =
 noinst_HEADERS =
diff --git a/gl/errno.in.h b/gl/errno.in.h
index f9612c3..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
diff --git a/gl/error.c b/gl/error.c
index 7d2bc71..865b293 100644
--- a/gl/error.c
+++ b/gl/error.c
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2007, 2009-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gl/error.h b/gl/error.h
index 9c2cb8b..afcb0e1 100644
--- a/gl/error.h
+++ b/gl/error.h
@@ -1,5 +1,5 @@
 /* Declaration for error-reporting function
-   Copyright (C) 1995-1997, 2003, 2006, 2008-2012 Free Software Foundation,
+   Copyright (C) 1995-1997, 2003, 2006, 2008-2013 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 
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 3108e4a..5c0a928 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/intprops.h b/gl/intprops.h
index 2485c78..f57f9b4 100644
--- a/gl/intprops.h
+++ b/gl/intprops.h
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-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
@@ -89,7 +89,7 @@
 
 /* Return 1 if the __typeof__ keyword works.  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C
+#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
 # define _GL_HAVE___TYPEOF__ 1
 #else
 # define _GL_HAVE___TYPEOF__ 0
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/alloca.m4 b/gl/m4/alloca.m4
index 656924b..270abd0 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
 # alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2012 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
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/close.m4 b/gl/m4/close.m4
index 379e70d..bccd981 100644
--- a/gl/m4/close.m4
+++ b/gl/m4/close.m4
@@ -1,5 +1,5 @@
 # close.m4 serial 8
-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/csharp.m4 b/gl/m4/csharp.m4
index 6ec3223..eb1f419 100644
--- a/gl/m4/csharp.m4
+++ b/gl/m4/csharp.m4
@@ -1,5 +1,5 @@
 # csharp.m4 serial 3
-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/csharpcomp.m4 b/gl/m4/csharpcomp.m4
index dc7c588..a7b04ad 100644
--- a/gl/m4/csharpcomp.m4
+++ b/gl/m4/csharpcomp.m4
@@ -1,5 +1,5 @@
 # csharpcomp.m4 serial 8
-dnl Copyright (C) 2003-2005, 2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2005, 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/csharpexec.m4 b/gl/m4/csharpexec.m4
index fab2611..c907416 100644
--- a/gl/m4/csharpexec.m4
+++ b/gl/m4/csharpexec.m4
@@ -1,5 +1,5 @@
 # csharpexec.m4 serial 4
-dnl Copyright (C) 2003-2005, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-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/dup2.m4 b/gl/m4/dup2.m4
index fc86e80..269cfdc 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -1,5 +1,5 @@
-#serial 18
-dnl Copyright (C) 2002, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+#serial 19
+dnl Copyright (C) 2002, 2005, 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.
@@ -39,6 +39,9 @@ AC_DEFUN([gl_FUNC_DUP2],
             /* Many gnulib modules require POSIX conformance of EBADF.  */
             if (dup2 (2, 1000000) == -1 && errno != EBADF)
               result |= 16;
+            /* Flush out a cygwin core dump.  */
+            if (dup2 (2, -1) != -1 || errno != EBADF)
+              result |= 32;
             return result;
            ])
         ],
diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
index 9e5df45..c640ec1 100644
--- a/gl/m4/eealloc.m4
+++ b/gl/m4/eealloc.m4
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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/environ.m4 b/gl/m4/environ.m4
index 8eb57c9..593a33e 100644
--- a/gl/m4/environ.m4
+++ b/gl/m4/environ.m4
@@ -1,5 +1,5 @@
 # environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-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/errno_h.m4 b/gl/m4/errno_h.m4
index 4e33ba8..c813ea5 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc.
+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.
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
index 1190e32..29e6fdc 100644
--- a/gl/m4/error.m4
+++ b/gl/m4/error.m4
@@ -1,6 +1,6 @@
 #serial 14
 
-# Copyright (C) 1996-1998, 2001-2004, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 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/extensions.m4 b/gl/m4/extensions.m4
index 6d17d8a..e30f122 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
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
 # 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 0a9fc9a..94b46dd 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -1,6 +1,6 @@
 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.
@@ -18,13 +18,24 @@ AC_DEFUN([gl_EXTERN_INLINE],
    _GL_INLINE_HEADER_END contains useful stuff to put
      in the same include file, after uses of _GL_INLINE.
 
-   Suppress the use of extern inline on Apple's platforms,
-   as Libc-825.25 (2012-09-19) is incompatible with it; see
+   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 extern inline with Sun C in standards-conformance mode, as it
+   mishandles inline functions that call each other.  E.g., for 'inline void f
+   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+   'reference to static identifier "f" in extern inline function'.
+   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+   Suppress the use of extern inline on Apple's platforms, as Libc at least
+   through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
    <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__) \
+      : (199901L <= __STDC_VERSION__ \
+         && !defined __HP_cc \
+         && !(defined __SUNPRO_C && __STDC__))) \
      && !defined __APPLE__)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
index 740e78b..87cc4bd 100644
--- a/gl/m4/fcntl-o.m4
+++ b/gl/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
 # fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 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/fcntl_h.m4 b/gl/m4/fcntl_h.m4
index cac28ae..3cff1fd 100644
--- a/gl/m4/fcntl_h.m4
+++ b/gl/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
 # serial 15
 # Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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/fdopen.m4 b/gl/m4/fdopen.m4
index 14f1554..74d1649 100644
--- a/gl/m4/fdopen.m4
+++ b/gl/m4/fdopen.m4
@@ -1,5 +1,5 @@
 # fdopen.m4 serial 3
-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/fstat.m4 b/gl/m4/fstat.m4
index a73baa2..b2cf2ad 100644
--- a/gl/m4/fstat.m4
+++ b/gl/m4/fstat.m4
@@ -1,5 +1,5 @@
 # fstat.m4 serial 4
-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/getcwd.m4 b/gl/m4/getcwd.m4
index 50b96c6..6f91bd9 100644
--- a/gl/m4/getcwd.m4
+++ b/gl/m4/getcwd.m4
@@ -1,6 +1,6 @@
 # getcwd.m4 - check for working getcwd that is compatible with glibc
 
-# Copyright (C) 2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 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,
 # with or without modifications, as long as this notice is preserved.
@@ -123,7 +123,7 @@ AC_DEFUN([gl_FUNC_GETCWD],
   dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
   dnl if appropriate.
   case "$gl_cv_func_getcwd_path_max" in
-    "no, it has the AIX bug") ;;
+    "no"|"no, it has the AIX bug") ;;
     *)
       AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
         [Define to 1 if getcwd minimally works, that is, its result can be
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
new file mode 100644
index 0000000..8f04b3b
--- /dev/null
+++ b/gl/m4/getdtablesize.m4
@@ -0,0 +1,17 @@
+# getdtablesize.m4 serial 4
+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.
+
+AC_DEFUN([gl_FUNC_GETDTABLESIZE],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([getdtablesize])
+  if test $ac_cv_func_getdtablesize != yes; then
+    HAVE_GETDTABLESIZE=0
+  fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
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/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 36620d9..1ea8e14 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 e6a49df..6ca45fc 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
@@ -73,6 +73,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module gendocs:
   # Code from module getcwd-lgpl:
   # Code from module getcwd-lgpl-tests:
+  # Code from module getdtablesize:
+  # Code from module getdtablesize-tests:
   # Code from module getopt-gnu:
   # Code from module getopt-posix:
   # Code from module getopt-posix-tests:
@@ -332,6 +334,12 @@ changequote([, ])dnl
     AC_LIBOBJ([getcwd-lgpl])
   fi
   gl_UNISTD_MODULE_INDICATOR([getcwd])
+  gl_FUNC_GETDTABLESIZE
+  if test $HAVE_GETDTABLESIZE = 0; then
+    AC_LIBOBJ([getdtablesize])
+    gl_PREREQ_GETDTABLESIZE
+  fi
+  gl_UNISTD_MODULE_INDICATOR([getdtablesize])
   gl_INTTYPES_H
   gl_INTTYPES_INCOMPLETE
   AC_REQUIRE([gl_LARGEFILE])
@@ -358,6 +366,7 @@ changequote([, ])dnl
   gl_FUNC_PUTENV
   if test $REPLACE_PUTENV = 1; then
     AC_LIBOBJ([putenv])
+    gl_PREREQ_PUTENV
   fi
   gl_STDLIB_MODULE_INDICATOR([putenv])
   gl_FUNC_SETENV
@@ -373,8 +382,8 @@ changequote([, ])dnl
   gl_SYS_STAT_MODULE_INDICATOR([stat])
   AM_STDBOOL_H
   gl_STDINT_H
-  gt_TYPE_WCHAR_T
-  gt_TYPE_WINT_T
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
   gl_STDIO_H
   gl_STDLIB_H
   gl_FUNC_SYMLINK
@@ -548,6 +557,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/fdopen.m4
   m4/fstat.m4
   m4/getcwd.m4
+  m4/getdtablesize.m4
   m4/getopt.m4
   m4/gnulib-common.m4
   m4/include_next.m4
@@ -609,6 +619,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-fstat.c
   tests/test-fwrite.c
   tests/test-getcwd-lgpl.c
+  tests/test-getdtablesize.c
   tests/test-getopt.c
   tests/test-getopt.h
   tests/test-getopt_long.h
@@ -652,6 +663,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests=lib/fdopen.c
   tests=lib/fstat.c
   tests=lib/getcwd-lgpl.c
+  tests=lib/getdtablesize.c
   tests=lib/ignore-value.h
   tests=lib/inttypes.in.h
   tests=lib/lstat.c
@@ -667,7 +679,6 @@ AC_DEFUN([gl_FILE_LIST], [
   tests=lib/stat.c
   tests=lib/stdbool.in.h
   tests=lib/stdint.in.h
-  tests=lib/stdio.c
   tests=lib/stdio.in.h
   tests=lib/stdlib.in.h
   tests=lib/symlink.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/inttypes-pri.m4 b/gl/m4/inttypes-pri.m4
index 977206f..e5a1e05 100644
--- a/gl/m4/inttypes-pri.m4
+++ b/gl/m4/inttypes-pri.m4
@@ -1,5 +1,5 @@
 # inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-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/inttypes.m4 b/gl/m4/inttypes.m4
index eec4f41..3b483d3 100644
--- a/gl/m4/inttypes.m4
+++ b/gl/m4/inttypes.m4
@@ -1,5 +1,5 @@
 # inttypes.m4 serial 26
-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/lstat.m4 b/gl/m4/lstat.m4
index 01b4eb9..5f4db64 100644
--- a/gl/m4/lstat.m4
+++ b/gl/m4/lstat.m4
@@ -1,6 +1,6 @@
 # serial 26
 
-# Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-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/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/malloca.m4 b/gl/m4/malloca.m4
index 7841979..791ce10 100644
--- a/gl/m4/malloca.m4
+++ b/gl/m4/malloca.m4
@@ -1,5 +1,5 @@
 # malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2012 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index f3cb23b..be6d4c9 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,5 +1,5 @@
 # manywarnings.m4 serial 5
-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.
@@ -98,6 +98,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -W \
     -Wabi \
     -Waddress \
+    -Waggressive-loop-optimizations \
     -Wall \
     -Warray-bounds \
     -Wattributes \
@@ -125,7 +126,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wformat-security \
     -Wformat-y2k \
     -Wformat-zero-length \
-    -Wformat=2 \
     -Wfree-nonheap-object \
     -Wignored-qualifiers \
     -Wimplicit \
@@ -143,9 +143,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wmissing-braces \
     -Wmissing-declarations \
     -Wmissing-field-initializers \
-    -Wmissing-format-attribute \
     -Wmissing-include-dirs \
-    -Wmissing-noreturn \
     -Wmissing-parameter-type \
     -Wmissing-prototypes \
     -Wmudflap \
@@ -166,6 +164,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wpointer-sign \
     -Wpointer-to-int-cast \
     -Wpragmas \
+    -Wreturn-local-addr \
     -Wreturn-type \
     -Wsequence-point \
     -Wshadow \
@@ -187,7 +186,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wtype-limits \
     -Wuninitialized \
     -Wunknown-pragmas \
-    -Wunreachable-code \
     -Wunsafe-loop-optimizations \
     -Wunused \
     -Wunused-but-set-parameter \
diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
index 40f612a..d5b66d4 100644
--- a/gl/m4/mode_t.m4
+++ b/gl/m4/mode_t.m4
@@ -1,5 +1,5 @@
 # mode_t.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/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/open.m4 b/gl/m4/open.m4
index 2577a22..a6cb101 100644
--- a/gl/m4/open.m4
+++ b/gl/m4/open.m4
@@ -1,5 +1,5 @@
 # open.m4 serial 14
-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/pathmax.m4 b/gl/m4/pathmax.m4
index 0117861..e11bf57 100644
--- a/gl/m4/pathmax.m4
+++ b/gl/m4/pathmax.m4
@@ -1,5 +1,5 @@
 # pathmax.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/putenv.m4 b/gl/m4/putenv.m4
index b971b12..c33b5b5 100644
--- a/gl/m4/putenv.m4
+++ b/gl/m4/putenv.m4
@@ -1,5 +1,5 @@
-# putenv.m4 serial 19
-dnl Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# putenv.m4 serial 20
+dnl Copyright (C) 2002-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.
@@ -48,3 +48,9 @@ AC_DEFUN([gl_FUNC_PUTENV],
       ;;
   esac
 ])
+
+# Prerequisites of lib/putenv.c.
+AC_DEFUN([gl_PREREQ_PUTENV],
+[
+  AC_CHECK_DECLS([_putenv])
+])
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index e1931e7..cb5351a 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,5 +1,5 @@
 # setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-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/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/stat.m4 b/gl/m4/stat.m4
index 0fd117e..2456297 100644
--- a/gl/m4/stat.m4
+++ b/gl/m4/stat.m4
@@ -1,6 +1,6 @@
 # serial 11
 
-# 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,
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/stdbool.m4 b/gl/m4/stdbool.m4
index eabfa64..80d5559 100644
--- a/gl/m4/stdbool.m4
+++ b/gl/m4/stdbool.m4
@@ -1,6 +1,6 @@
 # Check for stdbool.h that conforms to C99.
 
-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/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 3bd6580..ebade06 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
 # stdio_h.m4 serial 43
-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/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index 9c69f2e..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])
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
index 1c96e52..3989844 100644
--- a/gl/m4/strerror.m4
+++ b/gl/m4/strerror.m4
@@ -1,5 +1,5 @@
 # strerror.m4 serial 17
-dnl Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 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/string_h.m4 b/gl/m4/string_h.m4
index 5677e09..cc5fbbb 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -1,6 +1,6 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# Copyright (C) 2007-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/symlink.m4 b/gl/m4/symlink.m4
index cfd90ec..82ede2a 100644
--- a/gl/m4/symlink.m4
+++ b/gl/m4/symlink.m4
@@ -1,7 +1,7 @@
 # serial 6
 # See if we need to provide symlink replacement.
 
-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/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index acfae41..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 23
-dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
+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.
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index 8af3353..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 28   -*- Autoconf -*-
-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/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/unistd_h.m4 b/gl/m4/unistd_h.m4
index f68fbff..32dcfa5 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
 # unistd_h.m4 serial 66
-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/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4
index 6f2790e..66f81fb 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..1848732 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.
+# warnings.m4 serial 8
+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.
@@ -27,7 +27,7 @@ AC_DEFUN([gl_COMPILER_OPTION_IF],
 AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
 AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
   gl_save_compiler_FLAGS="$gl_Flags"
-  gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $1"])
+  gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors 
$1"])
   AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
                     [AS_VAR_SET(gl_Warn, [yes])],
                     [AS_VAR_SET(gl_Warn, [no])])
@@ -38,6 +38,14 @@ AS_VAR_POPDEF([gl_Flags])dnl
 AS_VAR_POPDEF([gl_Warn])dnl
 ])
 
+# gl_UNKNOWN_WARNINGS_ARE_ERRORS
+# ------------------------------
+# Clang doesn't complain about unknown warning options unless one also
+# specifies -Wunknown-warning-option -Werror.  Detect this.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
+   [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
+   [gl_unknown_warnings_are_errors=])])
 
 # gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
 #             [PROGRAM = AC_LANG_PROGRAM()])
@@ -47,7 +55,8 @@ AS_VAR_POPDEF([gl_Warn])dnl
 #
 # If VARIABLE is a variable name, AC_SUBST it.
 AC_DEFUN([gl_WARN_ADD],
-[gl_COMPILER_OPTION_IF([$1],
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+gl_COMPILER_OPTION_IF([$1],
   [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
   [],
   [$3])
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
index c7a8b2d..bedb15a 100644
--- a/gl/m4/wchar_h.m4
+++ b/gl/m4/wchar_h.m4
@@ -1,6 +1,6 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-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/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/m4/wint_t.m4 b/gl/m4/wint_t.m4
index 3260cce..d7cd3db 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
 # wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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/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 bb5e989..96ddf8a 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/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/strerror-override.c b/gl/strerror-override.c
index f7cac65..d0ed2fb 100644
--- a/gl/strerror-override.c
+++ b/gl/strerror-override.c
@@ -1,6 +1,6 @@
 /* strerror-override.c --- POSIX compatible system error routine
 
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/strerror-override.h b/gl/strerror-override.h
index 6468681..3b8f24b 100644
--- a/gl/strerror-override.h
+++ b/gl/strerror-override.h
@@ -1,6 +1,6 @@
 /* strerror-override.h --- POSIX compatible system error routine
 
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/strerror.c b/gl/strerror.c
index 587bd21..80a2f2e 100644
--- a/gl/strerror.c
+++ b/gl/strerror.c
@@ -1,6 +1,6 @@
 /* strerror.c --- POSIX compatible system error routine
 
-   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/string.in.h b/gl/string.in.h
index f8d7520..d7a6c9c 100644
--- a/gl/string.in.h
+++ b/gl/string.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2012 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 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
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/unistd.in.h b/gl/unistd.in.h
index 6171f77..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,6 +112,7 @@
 /* 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
 
diff --git a/gl/verify.h b/gl/verify.h
index 0c320b1..03492ef 100644
--- a/gl/verify.h
+++ b/gl/verify.h
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2005-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
@@ -31,7 +31,9 @@
    Use this only with GCC.  If we were willing to slow 'configure'
    down we could also use it with other compilers, but since this
    affects only the quality of diagnostics, why bother?  */
-# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined 
__cplusplus
+# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+      && (201112L <= __STDC_VERSION__  || !defined __STRICT_ANSI__) \
+      && !defined __cplusplus)
 #  define _GL_HAVE__STATIC_ASSERT 1
 # endif
 /* The condition (99 < __GNUC__) is temporary, until we know about the
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/gltests/Makefile.am b/gltests/Makefile.am
index b4c5568..c41aa1c 100644
--- a/gltests/Makefile.am
+++ b/gltests/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
@@ -22,7 +22,7 @@
 #
 # Generated by gnulib-tool.
 
-AUTOMAKE_OPTIONS = 1.5 foreign
+AUTOMAKE_OPTIONS = 1.9.6 foreign
 
 SUBDIRS = .
 TESTS =
@@ -291,6 +291,23 @@ EXTRA_DIST += test-getcwd-lgpl.c signature.h macros.h
 
 ## end   gnulib module getcwd-lgpl-tests
 
+## begin gnulib module getdtablesize
+
+
+EXTRA_DIST += getdtablesize.c
+
+EXTRA_libtests_a_SOURCES += getdtablesize.c
+
+## end   gnulib module getdtablesize
+
+## begin gnulib module getdtablesize-tests
+
+TESTS += test-getdtablesize
+check_PROGRAMS += test-getdtablesize
+EXTRA_DIST += test-getdtablesize.c signature.h macros.h
+
+## end   gnulib module getdtablesize-tests
+
 ## begin gnulib module getopt-posix-tests
 
 TESTS += test-getopt
@@ -682,7 +699,6 @@ EXTRA_DIST += test-stdint.c
 ## begin gnulib module stdio
 
 BUILT_SOURCES += stdio.h
-libtests_a_SOURCES += stdio.c
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
@@ -854,6 +870,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' \
@@ -882,6 +899,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' \
diff --git a/gltests/alloca.in.h b/gltests/alloca.in.h
index d20f4b8..72d28ee 100644
--- a/gltests/alloca.in.h
+++ b/gltests/alloca.in.h
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2013 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
diff --git a/gltests/binary-io.h b/gltests/binary-io.h
index 0f376e3..317fe3d 100644
--- a/gltests/binary-io.h
+++ b/gltests/binary-io.h
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright (C) 2001, 2003, 2005, 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 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/gltests/close.c b/gltests/close.c
index 4b7accb..f620e54 100644
--- a/gltests/close.c
+++ b/gltests/close.c
@@ -1,5 +1,5 @@
 /* close replacement.
-   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/gltests/dosname.h b/gltests/dosname.h
index 0468ce4..ba63ce4 100644
--- a/gltests/dosname.h
+++ b/gltests/dosname.h
@@ -1,6 +1,6 @@
 /* File names on MS-DOS/Windows systems.
 
-   Copyright (C) 2000-2001, 2004-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2000-2001, 2004-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/gltests/dup2.c b/gltests/dup2.c
index f6d0f1c..9219eb3 100644
--- a/gltests/dup2.c
+++ b/gltests/dup2.c
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor to a specified file descriptor.
 
-   Copyright (C) 1999, 2004-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1999, 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
@@ -95,7 +95,10 @@ rpl_dup2 (int fd, int desired_fd)
 # ifdef F_GETFL
   /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
      On Cygwin 1.5.x, dup2 (1, 1) returns 0.
+     On Cygwin 1.7.17, dup2 (1, -1) dumps core.
      On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC.  */
+  if (desired_fd < 0)
+    fd = desired_fd;
   if (fd == desired_fd)
     return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
 # endif
diff --git a/gltests/fcntl.in.h b/gltests/fcntl.in.h
index 604c31b..1e45a65 100644
--- a/gltests/fcntl.in.h
+++ b/gltests/fcntl.in.h
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   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/gltests/fd-hook.c b/gltests/fd-hook.c
index 8f4ffe2..e158a52 100644
--- a/gltests/fd-hook.c
+++ b/gltests/fd-hook.c
@@ -1,5 +1,5 @@
 /* Hook for making making file descriptor functions close(), ioctl() 
extensible.
-   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2009.
 
    This program is free software: you can redistribute it and/or modify it
diff --git a/gltests/fd-hook.h b/gltests/fd-hook.h
index 721e9ad..d15b577 100644
--- a/gltests/fd-hook.h
+++ b/gltests/fd-hook.h
@@ -1,5 +1,5 @@
 /* Hook for making making file descriptor functions close(), ioctl() 
extensible.
-   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
diff --git a/gltests/fdopen.c b/gltests/fdopen.c
index 6595b16..c717f71 100644
--- a/gltests/fdopen.c
+++ b/gltests/fdopen.c
@@ -1,5 +1,5 @@
 /* Open a stream with a given file descriptor.
-   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/gltests/fstat.c b/gltests/fstat.c
index 0418cc6..dc802f5 100644
--- a/gltests/fstat.c
+++ b/gltests/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
diff --git a/gltests/getcwd-lgpl.c b/gltests/getcwd-lgpl.c
index f1e821b..d550f35 100644
--- a/gltests/getcwd-lgpl.c
+++ b/gltests/getcwd-lgpl.c
@@ -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 gnulib.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gltests/getdtablesize.c b/gltests/getdtablesize.c
new file mode 100644
index 0000000..9947405
--- /dev/null
+++ b/gltests/getdtablesize.c
@@ -0,0 +1,86 @@
+/* getdtablesize() function for platforms that don't have it.
+   Copyright (C) 2008-2013 Free Software Foundation, Inc.
+   Written by Bruno Haible <address@hidden>, 2008.
+
+   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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+#include <stdio.h>
+
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+_setmaxstdio_nothrow (int newmax)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _setmaxstdio (newmax);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+# define _setmaxstdio _setmaxstdio_nothrow
+#endif
+
+/* Cache for the previous getdtablesize () result.  */
+static int dtablesize;
+
+int
+getdtablesize (void)
+{
+  if (dtablesize == 0)
+    {
+      /* We are looking for the number N such that the valid file descriptors
+         are 0..N-1.  It can be obtained through a loop as follows:
+           {
+             int fd;
+             for (fd = 3; fd < 65536; fd++)
+               if (dup2 (0, fd) == -1)
+                 break;
+             return fd;
+           }
+         On Windows XP, the result is 2048.
+         The drawback of this loop is that it allocates memory for a libc
+         internal array that is never freed.
+
+         The number N can also be obtained as the upper bound for
+         _getmaxstdio ().  _getmaxstdio () returns the maximum number of open
+         FILE objects.  The sanity check in _setmaxstdio reveals the maximum
+         number of file descriptors.  This too allocates memory, but it is
+         freed when we call _setmaxstdio with the original value.  */
+      int orig_max_stdio = _getmaxstdio ();
+      unsigned int bound;
+      for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
+        ;
+      _setmaxstdio (orig_max_stdio);
+      dtablesize = bound;
+    }
+  return dtablesize;
+}
+
+#endif
diff --git a/gltests/ignore-value.h b/gltests/ignore-value.h
index 2e34435..63ecde8 100644
--- a/gltests/ignore-value.h
+++ b/gltests/ignore-value.h
@@ -1,6 +1,6 @@
 /* ignore a function return without a compiler warning
 
-   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/gltests/init.sh b/gltests/init.sh
index 5f6e638..bd2048e 100644
--- a/gltests/init.sh
+++ b/gltests/init.sh
@@ -1,6 +1,6 @@
 # source this file; set up for tests
 
-# 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/gltests/inttypes.in.h b/gltests/inttypes.in.h
index b9da2b5..1893f55 100644
--- a/gltests/inttypes.in.h
+++ b/gltests/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2013 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Derek Price.
    This file is part of gnulib.
 
diff --git a/gltests/lstat.c b/gltests/lstat.c
index 97fe6bb..1a613a8 100644
--- a/gltests/lstat.c
+++ b/gltests/lstat.c
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 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/gltests/macros.h b/gltests/macros.h
index 478004c..60ba894 100644
--- a/gltests/macros.h
+++ b/gltests/macros.h
@@ -1,5 +1,5 @@
 /* Common macros used by gnulib tests.
-   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/gltests/malloc.c b/gltests/malloc.c
index e0d5c89..908735d 100644
--- a/gltests/malloc.c
+++ b/gltests/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/gltests/malloca.c b/gltests/malloca.c
index 1f7533a..311be56 100644
--- a/gltests/malloca.c
+++ b/gltests/malloca.c
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -49,12 +49,18 @@
 #define MAGIC_SIZE sizeof (int)
 /* This is how the header info would look like without any alignment
    considerations.  */
-struct preliminary_header { void *next; char room[MAGIC_SIZE]; };
+struct preliminary_header { void *next; int magic; };
 /* But the header's size must be a multiple of sa_alignment_max.  */
 #define HEADER_SIZE \
   (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / 
sa_alignment_max) * sa_alignment_max)
-struct header { void *next; char room[HEADER_SIZE - sizeof (struct 
preliminary_header) + MAGIC_SIZE]; };
-verify (HEADER_SIZE == sizeof (struct header));
+union header {
+  void *next;
+  struct {
+    char room[HEADER_SIZE - MAGIC_SIZE];
+    int word;
+  } magic;
+};
+verify (HEADER_SIZE == sizeof (union header));
 /* We make the hash table quite big, so that during lookups the probability
    of empty hash buckets is quite high.  There is no need to make the hash
    table resizable, because when the hash table gets filled so much that the
@@ -74,20 +80,21 @@ mmalloca (size_t n)
 
   if (nplus >= n)
     {
-      char *p = (char *) malloc (nplus);
+      void *p = malloc (nplus);
 
       if (p != NULL)
         {
           size_t slot;
+          union header *h = p;
 
-          p += HEADER_SIZE;
+          p = h + 1;
 
           /* Put a magic number into the indicator word.  */
-          ((int *) p)[-1] = MAGIC_NUMBER;
+          h->magic.word = MAGIC_NUMBER;
 
           /* Enter p into the hash table.  */
           slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot];
+          h->next = mmalloca_results[slot];
           mmalloca_results[slot] = p;
 
           return p;
@@ -123,15 +130,17 @@ freea (void *p)
           void **chain = &mmalloca_results[slot];
           for (; *chain != NULL;)
             {
+              union header *h = p;
               if (*chain == p)
                 {
                   /* Found it.  Remove it from the hash table and free it.  */
-                  char *p_begin = (char *) p - HEADER_SIZE;
-                  *chain = ((struct header *) p_begin)->next;
+                  union header *p_begin = h - 1;
+                  *chain = p_begin->next;
                   free (p_begin);
                   return;
                 }
-              chain = &((struct header *) ((char *) *chain - 
HEADER_SIZE))->next;
+              h = *chain;
+              chain = &h[-1].next;
             }
         }
       /* At this point, we know it was not a mmalloca() result.  */
diff --git a/gltests/malloca.h b/gltests/malloca.h
index f06e9e7..6fbe45e 100644
--- a/gltests/malloca.h
+++ b/gltests/malloca.h
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -92,7 +92,7 @@ extern void * nmalloca (size_t n, size_t s);
 /* ------------------- Auxiliary, non-public definitions ------------------- */
 
 /* Determine the alignment of a type at compile time.  */
-#if defined __GNUC__
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
 # define sa_alignof __alignof__
 #elif defined __cplusplus
   template <class type> struct sa_alignof_helper { char __slot1; type __slot2; 
};
diff --git a/gltests/open.c b/gltests/open.c
index bdfc8db..a0c43ea 100644
--- a/gltests/open.c
+++ b/gltests/open.c
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   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/gltests/pathmax.h b/gltests/pathmax.h
index 03db7cb..a9ddc33 100644
--- a/gltests/pathmax.h
+++ b/gltests/pathmax.h
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2012 Free Software
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2013 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/gltests/putenv.c b/gltests/putenv.c
index 3c0f7ea..5461273 100644
--- a/gltests/putenv.c
+++ b/gltests/putenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2012 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2013 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
@@ -34,6 +34,11 @@
 #include <string.h>
 #include <unistd.h>
 
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 #if _LIBC
 # if HAVE_GNU_LD
 #  define environ __environ
@@ -57,7 +62,9 @@ static int
 _unsetenv (const char *name)
 {
   size_t len;
+#if !HAVE_DECL__PUTENV
   char **ep;
+#endif
 
   if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
     {
@@ -67,6 +74,21 @@ _unsetenv (const char *name)
 
   len = strlen (name);
 
+#if HAVE_DECL__PUTENV
+  {
+    int putenv_result, putenv_errno;
+    char *name_ = malloc (len + 2);
+    memcpy (name_, name, len);
+    name_[len] = '=';
+    name_[len + 1] = 0;
+    putenv_result = _putenv (name_);
+    putenv_errno = errno;
+    free (name_);
+    __set_errno (putenv_errno);
+    return putenv_result;
+  }
+#else
+
   LOCK;
 
   ep = environ;
@@ -87,6 +109,7 @@ _unsetenv (const char *name)
   UNLOCK;
 
   return 0;
+#endif
 }
 
 
@@ -95,9 +118,8 @@ _unsetenv (const char *name)
 int
 putenv (char *string)
 {
-  const char *const name_end = strchr (string, '=');
-  register size_t size;
-  register char **ep;
+  const char *name_end = strchr (string, '=');
+  char **ep;
 
   if (name_end == NULL)
     {
@@ -105,30 +127,68 @@ putenv (char *string)
       return _unsetenv (string);
     }
 
-  size = 0;
-  for (ep = environ; *ep != NULL; ++ep)
-    if (!strncmp (*ep, string, name_end - string) &&
-        (*ep)[name_end - string] == '=')
+#if HAVE_DECL__PUTENV
+  /* Rely on _putenv to allocate the new environment.  If other
+     parts of the application use _putenv, the !HAVE_DECL__PUTENV code
+     would fight over who owns the environ vector, causing a crash.  */
+  if (name_end[1])
+    return _putenv (string);
+  else
+    {
+      /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
+         to allocate the environ vector and then replace the new
+         entry with "NAME=".  */
+      int putenv_result, putenv_errno;
+      char *name_x = malloc (name_end - string + sizeof "= ");
+      if (!name_x)
+        return -1;
+      memcpy (name_x, string, name_end - string + 1);
+      name_x[name_end - string + 1] = ' ';
+      name_x[name_end - string + 2] = 0;
+      putenv_result = _putenv (name_x);
+      putenv_errno = errno;
+      for (ep = environ; *ep; ep++)
+        if (strcmp (*ep, name_x) == 0)
+          {
+            *ep = string;
+            break;
+          }
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+      if (putenv_result == 0)
+        {
+          /* _putenv propagated "NAME= " into the subprocess environment;
+             fix that by calling SetEnvironmentVariable directly.  */
+          name_x[name_end - string] = 0;
+          putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
+          putenv_errno = ENOMEM; /* ENOMEM is the only way to fail.  */
+        }
+# endif
+      free (name_x);
+      __set_errno (putenv_errno);
+      return putenv_result;
+    }
+#else
+  for (ep = environ; *ep; ep++)
+    if (strncmp (*ep, string, name_end - string) == 0
+        && (*ep)[name_end - string] == '=')
       break;
-    else
-      ++size;
 
-  if (*ep == NULL)
+  if (*ep)
+    *ep = string;
+  else
     {
       static char **last_environ = NULL;
-      char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
-      if (new_environ == NULL)
+      size_t size = ep - environ;
+      char **new_environ = malloc ((size + 2) * sizeof *new_environ);
+      if (! new_environ)
         return -1;
-      (void) memcpy ((void *) new_environ, (void *) environ,
-                     size * sizeof (char *));
-      new_environ[size] = (char *) string;
-      new_environ[size + 1] = NULL;
+      new_environ[0] = string;
+      memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ);
       free (last_environ);
       last_environ = new_environ;
       environ = new_environ;
     }
-  else
-    *ep = string;
 
   return 0;
+#endif
 }
diff --git a/gltests/same-inode.h b/gltests/same-inode.h
index 8c3900d..3843b07 100644
--- a/gltests/same-inode.h
+++ b/gltests/same-inode.h
@@ -1,6 +1,6 @@
 /* Determine whether two stat buffers refer to the same file.
 
-   Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/gltests/setenv.c b/gltests/setenv.c
index 8201be2..995a0f2 100644
--- a/gltests/setenv.c
+++ b/gltests/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -15,14 +15,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #if !_LIBC
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the name == NULL test below.  */
+# define _GL_ARG_NONNULL(params)
+
 # define _GL_USE_STDLIB_ALLOC 1
 # include <config.h>
 #endif
 
-/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
-   optimizes away the name == NULL test below.  */
-#define _GL_ARG_NONNULL(params)
-
 #include <alloca.h>
 
 /* Specification.  */
diff --git a/gltests/signature.h b/gltests/signature.h
index d9d8b47..45a8e02 100644
--- a/gltests/signature.h
+++ b/gltests/signature.h
@@ -1,5 +1,5 @@
 /* Macro for checking that a function declaration is compliant.
-   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/gltests/stat.c b/gltests/stat.c
index c0bcb88..f888130 100644
--- a/gltests/stat.c
+++ b/gltests/stat.c
@@ -1,5 +1,5 @@
 /* Work around platform bugs in stat.
-   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/gltests/stdbool.in.h b/gltests/stdbool.in.h
index 1f8caee..7c15772 100644
--- a/gltests/stdbool.in.h
+++ b/gltests/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-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/gltests/stdint.in.h b/gltests/stdint.in.h
index e2a0eb1..2db8b2e 100644
--- a/gltests/stdint.in.h
+++ b/gltests/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.
 
@@ -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/gltests/stdio.c b/gltests/stdio.c
deleted file mode 100644
index e6ed829..0000000
--- a/gltests/stdio.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <config.h>
-#define _GL_STDIO_INLINE _GL_EXTERN_INLINE
-#include "stdio.h"
diff --git a/gltests/stdio.in.h b/gltests/stdio.in.h
index f3b52d2..06cbad0 100644
--- a/gltests/stdio.in.h
+++ b/gltests/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
@@ -46,11 +46,6 @@
 #ifndef address@hidden@_STDIO_H
 #define address@hidden@_STDIO_H
 
-_GL_INLINE_HEADER_BEGIN
-#ifndef _GL_STDIO_INLINE
-# define _GL_STDIO_INLINE _GL_INLINE
-#endif
-
 /* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
 
@@ -580,21 +575,27 @@ _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
-_GL_STDIO_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 clang, 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
+#   undef fwrite_unlocked
+extern size_t __REDIRECT (rpl_fwrite,
+                          (const void *__restrict, size_t, size_t,
+                           FILE *__restrict),
+                          fwrite);
+extern size_t __REDIRECT (rpl_fwrite_unlocked,
+                          (const void *__restrict, size_t, size_t,
+                           FILE *__restrict),
+                          fwrite_unlocked);
 #   define fwrite rpl_fwrite
+#   define fwrite_unlocked rpl_fwrite_unlocked
 #  endif
 # endif
 _GL_CXXALIASWARN (fwrite);
@@ -1338,8 +1339,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX 
compliant - "
                       "POSIX compliance");
 #endif
 
-_GL_INLINE_HEADER_END
-
 #endif /* address@hidden@_STDIO_H */
 #endif /* address@hidden@_STDIO_H */
 #endif
diff --git a/gltests/stdlib.in.h b/gltests/stdlib.in.h
index 6555840..c955248 100644
--- a/gltests/stdlib.in.h
+++ b/gltests/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@
 
@@ -766,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/gltests/symlink.c b/gltests/symlink.c
index 642ca66..d3c9f21 100644
--- a/gltests/symlink.c
+++ b/gltests/symlink.c
@@ -1,5 +1,5 @@
 /* Stub for symlink().
-   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/gltests/sys_stat.in.h b/gltests/sys_stat.in.h
index ac05ddb..acc3694 100644
--- a/gltests/sys_stat.in.h
+++ b/gltests/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)
diff --git a/gltests/test-alloca-opt.c b/gltests/test-alloca-opt.c
index 6b9a4d7..d94e1d1 100644
--- a/gltests/test-alloca-opt.c
+++ b/gltests/test-alloca-opt.c
@@ -1,5 +1,5 @@
 /* Test of optional automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/gltests/test-binary-io.c b/gltests/test-binary-io.c
index 4f284e7..b258d51 100644
--- a/gltests/test-binary-io.c
+++ b/gltests/test-binary-io.c
@@ -1,5 +1,5 @@
 /* Test of binary mode I/O.
-   Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2005, 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/gltests/test-close.c b/gltests/test-close.c
index 83f71c0..974ed1b 100644
--- a/gltests/test-close.c
+++ b/gltests/test-close.c
@@ -1,5 +1,5 @@
 /* Test closing a file or socket.
-   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
@@ -35,6 +35,7 @@ main (void)
     ASSERT (errno == EBADF);
   }
   {
+    close (99);
     errno = 0;
     ASSERT (close (99) == -1);
     ASSERT (errno == EBADF);
diff --git a/gltests/test-dup2.c b/gltests/test-dup2.c
index 5043c0c..ecb2692 100644
--- a/gltests/test-dup2.c
+++ b/gltests/test-dup2.c
@@ -1,5 +1,5 @@
 /* Test duplicating file descriptors.
-   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
@@ -26,6 +26,10 @@ SIGNATURE_CHECK (dup2, int, (int, int));
 #include <errno.h>
 #include <fcntl.h>
 
+#if HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
+
 #include "binary-io.h"
 
 #if GNULIB_TEST_CLOEXEC
@@ -103,6 +107,7 @@ main (void)
 {
   const char *file = "test-dup2.tmp";
   char buffer[1];
+  int bad_fd = getdtablesize ();
   int fd = open (file, O_CREAT | O_TRUNC | O_RDWR, 0600);
 
   /* Assume std descriptors were provided by invoker.  */
@@ -122,6 +127,7 @@ main (void)
   errno = 0;
   ASSERT (dup2 (-1, fd) == -1);
   ASSERT (errno == EBADF);
+  close (99);
   errno = 0;
   ASSERT (dup2 (99, fd) == -1);
   ASSERT (errno == EBADF);
@@ -145,7 +151,7 @@ main (void)
   ASSERT (dup2 (fd, -2) == -1);
   ASSERT (errno == EBADF);
   errno = 0;
-  ASSERT (dup2 (fd, 10000000) == -1);
+  ASSERT (dup2 (fd, bad_fd) == -1);
   ASSERT (errno == EBADF);
 
   /* Using dup2 can skip fds.  */
diff --git a/gltests/test-environ.c b/gltests/test-environ.c
index 972ed06..cb3d9f6 100644
--- a/gltests/test-environ.c
+++ b/gltests/test-environ.c
@@ -1,5 +1,5 @@
 /* Test of environ variable.
-   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/gltests/test-errno.c b/gltests/test-errno.c
index 8d00717..29eb510 100644
--- a/gltests/test-errno.c
+++ b/gltests/test-errno.c
@@ -1,5 +1,5 @@
 /* Test of <errno.h> substitute.
-   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/gltests/test-fdopen.c b/gltests/test-fdopen.c
index 8e2f7bf..671c5e3 100644
--- a/gltests/test-fdopen.c
+++ b/gltests/test-fdopen.c
@@ -1,5 +1,5 @@
 /* Test opening a stream with a file descriptor.
-   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
@@ -22,6 +22,7 @@
 SIGNATURE_CHECK (fdopen, FILE *, (int, const char *));
 
 #include <errno.h>
+#include <unistd.h>
 
 #include "macros.h"
 
@@ -42,6 +43,7 @@ main (void)
   {
     FILE *fp;
 
+    close (99);
     errno = 0;
     fp = fdopen (99, "r");
     if (fp == NULL)
diff --git a/gltests/test-fgetc.c b/gltests/test-fgetc.c
index f7ebbc6..b4a617a 100644
--- a/gltests/test-fgetc.c
+++ b/gltests/test-fgetc.c
@@ -1,5 +1,5 @@
 /* Test of fgetc() function.
-   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
@@ -77,7 +77,9 @@ main (int argc, char **argv)
       }
   }
   {
-    FILE *fp = fdopen (99, "r");
+    FILE *fp;
+    close (99);
+    fp = fdopen (99, "r");
     if (fp != NULL)
       {
         errno = 0;
diff --git a/gltests/test-fputc.c b/gltests/test-fputc.c
index fd92ae8..e05f641 100644
--- a/gltests/test-fputc.c
+++ b/gltests/test-fputc.c
@@ -1,5 +1,5 @@
 /* Test of fputc() function.
-   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
@@ -70,7 +70,9 @@ main (int argc, char **argv)
       }
   }
   {
-    FILE *fp = fdopen (99, "w");
+    FILE *fp;
+    close (99);
+    fp = fdopen (99, "w");
     if (fp != NULL)
       {
         setvbuf (fp, NULL, _IONBF, 0);
diff --git a/gltests/test-fread.c b/gltests/test-fread.c
index 792299b..a807e0a 100644
--- a/gltests/test-fread.c
+++ b/gltests/test-fread.c
@@ -1,5 +1,5 @@
 /* Test of fread() function.
-   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
@@ -79,7 +79,9 @@ main (int argc, char **argv)
       }
   }
   {
-    FILE *fp = fdopen (99, "r");
+    FILE *fp;
+    close (99);
+    fp = fdopen (99, "r");
     if (fp != NULL)
       {
         char buf[1];
diff --git a/gltests/test-fstat.c b/gltests/test-fstat.c
index 7f3c3c4..8ce1527 100644
--- a/gltests/test-fstat.c
+++ b/gltests/test-fstat.c
@@ -1,5 +1,5 @@
 /* Tests of fstat() function.
-   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
@@ -22,6 +22,7 @@
 SIGNATURE_CHECK (fstat, int, (int, struct stat *));
 
 #include <errno.h>
+#include <unistd.h>
 
 #include "macros.h"
 
@@ -39,6 +40,7 @@ main (int argc, char *argv[])
   {
     struct stat statbuf;
 
+    close (99);
     errno = 0;
     ASSERT (fstat (99, &statbuf) == -1);
     ASSERT (errno == EBADF);
diff --git a/gltests/test-fwrite.c b/gltests/test-fwrite.c
index 1f3a66d..ef72338 100644
--- a/gltests/test-fwrite.c
+++ b/gltests/test-fwrite.c
@@ -1,5 +1,5 @@
 /* Test of fwrite() function.
-   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
@@ -72,7 +72,9 @@ main (int argc, char **argv)
       }
   }
   {
-    FILE *fp = fdopen (99, "w");
+    FILE *fp;
+    close (99);
+    fp = fdopen (99, "w");
     if (fp != NULL)
       {
         char buf[5] = "world";
diff --git a/gltests/test-getcwd-lgpl.c b/gltests/test-getcwd-lgpl.c
index 3010760..e3e7b7a 100644
--- a/gltests/test-getcwd-lgpl.c
+++ b/gltests/test-getcwd-lgpl.c
@@ -1,5 +1,5 @@
 /* Test of getcwd() function.
-   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/lib/gltests/test-sys_types.c b/gltests/test-getdtablesize.c
similarity index 67%
copy from lib/gltests/test-sys_types.c
copy to gltests/test-getdtablesize.c
index c2af992..7046481 100644
--- a/lib/gltests/test-sys_types.c
+++ b/gltests/test-getdtablesize.c
@@ -1,5 +1,5 @@
-/* Test of <sys/types.h> substitute.
-   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+/* Test of getdtablesize() function.
+   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
@@ -14,21 +14,21 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Written by Bruno Haible <address@hidden>, 2011.  */
+/* Written by Bruno Haible <address@hidden>, 2008.  */
 
 #include <config.h>
 
-#include <sys/types.h>
+#include <unistd.h>
 
-/* Check that the types are all defined.  */
-pid_t t1;
-size_t t2;
-ssize_t t3;
-off_t t4;
-mode_t t5;
+#include "signature.h"
+SIGNATURE_CHECK (getdtablesize, int, (void));
+
+#include "macros.h"
 
 int
-main (void)
+main (int argc, char *argv[])
 {
+  ASSERT (getdtablesize () >= 3);
+
   return 0;
 }
diff --git a/gltests/test-getopt.c b/gltests/test-getopt.c
index e08a834..7caf027 100644
--- a/gltests/test-getopt.c
+++ b/gltests/test-getopt.c
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   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/gltests/test-getopt.h b/gltests/test-getopt.h
index 978b753..450cf0d 100644
--- a/gltests/test-getopt.h
+++ b/gltests/test-getopt.h
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   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/gltests/test-getopt_long.h b/gltests/test-getopt_long.h
index 9d55c65..345a796 100644
--- a/gltests/test-getopt_long.h
+++ b/gltests/test-getopt_long.h
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   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/gltests/test-ignore-value.c b/gltests/test-ignore-value.c
index f036134..cb4cf14 100644
--- a/gltests/test-ignore-value.c
+++ b/gltests/test-ignore-value.c
@@ -1,6 +1,6 @@
 /* Test the "ignore-value" module.
 
-   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/gltests/test-init.sh b/gltests/test-init.sh
index a2825cc..6eb6b43 100755
--- a/gltests/test-init.sh
+++ b/gltests/test-init.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for init.sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/gltests/test-intprops.c b/gltests/test-intprops.c
index aeb1168..8b91a79 100644
--- a/gltests/test-intprops.c
+++ b/gltests/test-intprops.c
@@ -1,5 +1,5 @@
 /* Test intprops.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/gltests/test-inttypes.c b/gltests/test-inttypes.c
index 698d3dc..db1a97e 100644
--- a/gltests/test-inttypes.c
+++ b/gltests/test-inttypes.c
@@ -1,5 +1,5 @@
 /* Test of <inttypes.h> substitute.
-   Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/gltests/test-lstat.c b/gltests/test-lstat.c
index 459bf88..d520193 100644
--- a/gltests/test-lstat.c
+++ b/gltests/test-lstat.c
@@ -1,5 +1,5 @@
 /* Test of lstat() function.
-   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/gltests/test-lstat.h b/gltests/test-lstat.h
index 4a81494..b8f1767 100644
--- a/gltests/test-lstat.h
+++ b/gltests/test-lstat.h
@@ -1,5 +1,5 @@
 /* Test of lstat() function.
-   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/gltests/test-malloca.c b/gltests/test-malloca.c
index 9c7109c..7d5e62e 100644
--- a/gltests/test-malloca.c
+++ b/gltests/test-malloca.c
@@ -1,5 +1,5 @@
 /* Test of safe automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/gltests/test-open.c b/gltests/test-open.c
index b9ec9bf..f04144f 100644
--- a/gltests/test-open.c
+++ b/gltests/test-open.c
@@ -1,5 +1,5 @@
 /* Test of opening a file descriptor.
-   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/gltests/test-open.h b/gltests/test-open.h
index cab1d27..babb239 100644
--- a/gltests/test-open.h
+++ b/gltests/test-open.h
@@ -1,5 +1,5 @@
 /* Test of opening a file descriptor.
-   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/gltests/test-pathmax.c b/gltests/test-pathmax.c
index c6d0ccc..81a0350 100644
--- a/gltests/test-pathmax.c
+++ b/gltests/test-pathmax.c
@@ -1,5 +1,5 @@
 /* Test of "pathmax.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/gltests/test-setenv.c b/gltests/test-setenv.c
index 4752a11..0a53ac4 100644
--- a/gltests/test-setenv.c
+++ b/gltests/test-setenv.c
@@ -1,5 +1,5 @@
 /* Tests of setenv.
-   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/gltests/test-stat.c b/gltests/test-stat.c
index db9adf9..b59dbf4 100644
--- a/gltests/test-stat.c
+++ b/gltests/test-stat.c
@@ -1,5 +1,5 @@
 /* Tests of stat.
-   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/gltests/test-stat.h b/gltests/test-stat.h
index 2c9afc0..5409e05 100644
--- a/gltests/test-stat.h
+++ b/gltests/test-stat.h
@@ -1,5 +1,5 @@
 /* Tests of stat.
-   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/gltests/test-stdbool.c b/gltests/test-stdbool.c
index c22ca1f..3c13ca2 100644
--- a/gltests/test-stdbool.c
+++ b/gltests/test-stdbool.c
@@ -1,5 +1,5 @@
 /* Test of <stdbool.h> substitute.
-   Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002-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/gltests/test-stddef.c b/gltests/test-stddef.c
index d7237b3..f42b4e0 100644
--- a/gltests/test-stddef.c
+++ b/gltests/test-stddef.c
@@ -1,5 +1,5 @@
 /* Test of <stddef.h> substitute.
-   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/gltests/test-stdint.c b/gltests/test-stdint.c
index 23b2b28..1c559b0 100644
--- a/gltests/test-stdint.c
+++ b/gltests/test-stdint.c
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   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/gltests/test-stdio.c b/gltests/test-stdio.c
index 7bd67c2..89c6548 100644
--- a/gltests/test-stdio.c
+++ b/gltests/test-stdio.c
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute.
-   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/gltests/test-strerror.c b/gltests/test-strerror.c
index 33dd901..6d5db0f 100644
--- a/gltests/test-strerror.c
+++ b/gltests/test-strerror.c
@@ -1,5 +1,5 @@
 /* Test of strerror() function.
-   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/gltests/test-symlink.c b/gltests/test-symlink.c
index b3caac9..9966516 100644
--- a/gltests/test-symlink.c
+++ b/gltests/test-symlink.c
@@ -1,5 +1,5 @@
 /* Tests of symlink.
-   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/gltests/test-symlink.h b/gltests/test-symlink.h
index a7c4079..56cdc84 100644
--- a/gltests/test-symlink.h
+++ b/gltests/test-symlink.h
@@ -1,5 +1,5 @@
 /* Tests of symlink.
-   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/gltests/test-sys_types.c b/gltests/test-sys_types.c
index c2af992..1045de7 100644
--- a/gltests/test-sys_types.c
+++ b/gltests/test-sys_types.c
@@ -1,5 +1,5 @@
 /* Test of <sys/types.h> substitute.
-   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/gltests/test-unsetenv.c b/gltests/test-unsetenv.c
index 926526d..c369e2a 100644
--- a/gltests/test-unsetenv.c
+++ b/gltests/test-unsetenv.c
@@ -1,5 +1,5 @@
 /* Tests of unsetenv.
-   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/gltests/test-vc-list-files-cvs.sh 
b/gltests/test-vc-list-files-cvs.sh
index 68b0a0f..1dbc532 100755
--- a/gltests/test-vc-list-files-cvs.sh
+++ b/gltests/test-vc-list-files-cvs.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for vc-list-files
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-2013 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/gltests/test-vc-list-files-git.sh 
b/gltests/test-vc-list-files-git.sh
index 1ea6d89..8cbd00b 100755
--- a/gltests/test-vc-list-files-git.sh
+++ b/gltests/test-vc-list-files-git.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for vc-list-files
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-2013 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/gltests/test-verify.c b/gltests/test-verify.c
index 5ab9c58..1056b4e 100644
--- a/gltests/test-verify.c
+++ b/gltests/test-verify.c
@@ -1,6 +1,6 @@
 /* Test the "verify" module.
 
-   Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/gltests/test-version-etc.c b/gltests/test-version-etc.c
index 36ced60..66027f3 100644
--- a/gltests/test-version-etc.c
+++ b/gltests/test-version-etc.c
@@ -1,5 +1,5 @@
 /* Test suite for version-etc.
-   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2009-2013 Free Software Foundation, Inc.
    This file is part of the GNUlib Library.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gltests/test-version-etc.sh b/gltests/test-version-etc.sh
index 945383b..466c959 100755
--- a/gltests/test-version-etc.sh
+++ b/gltests/test-version-etc.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Test suite for version-etc.
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/gltests/time.in.h b/gltests/time.in.h
index 04cde05..8ced794 100644
--- a/gltests/time.in.h
+++ b/gltests/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/gltests/unsetenv.c b/gltests/unsetenv.c
index ddbe9a4..c58c82f 100644
--- a/gltests/unsetenv.c
+++ b/gltests/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,12 +14,12 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <config.h>
-
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the name == NULL test below.  */
 #define _GL_ARG_NONNULL(params)
 
+#include <config.h>
+
 /* Specification.  */
 #include <stdlib.h>
 
diff --git a/gltests/version-etc-fsf.c b/gltests/version-etc-fsf.c
index c452f40..e1c69da 100644
--- a/gltests/version-etc-fsf.c
+++ b/gltests/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/gltests/wchar.in.h b/gltests/wchar.in.h
index f9bc30c..b6e4362 100644
--- a/gltests/wchar.in.h
+++ b/gltests/wchar.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   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/java/Makefile.am b/java/Makefile.am
index 68aa32a..2faf79f 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUBDIRS = gnu . misc
+SUBDIRS = src
 
 EXTRA_DIST = LICENSE-2.0.txt
 
@@ -27,18 +27,19 @@ libidn_jardir = $(datadir)/java
 dist_libidn_jar_DATA = libidn-$(VERSION).jar
 
 libidn-$(VERSION).jar:
-       $(JAR) cf $@ gnu/inet/encoding/CombiningClass.class     \
-               gnu/inet/encoding/Composition.class             \
-               gnu/inet/encoding/DecompositionKeys.class       \
-               gnu/inet/encoding/DecompositionMappings.class   \
-               gnu/inet/encoding/IDNA.class                    \
-               gnu/inet/encoding/IDNAException.class           \
-               gnu/inet/encoding/NFKC.class                    \
-               gnu/inet/encoding/Punycode.class                \
-               gnu/inet/encoding/PunycodeException.class       \
-               gnu/inet/encoding/RFC3454.class                 \
-               gnu/inet/encoding/Stringprep.class              \
-               gnu/inet/encoding/StringprepException.class
+       $(JAR) cf $@ \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/CombiningClass.class             \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/Composition.class                \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/DecompositionKeys.class          \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/DecompositionMappings.class      \
+               -C $(builddir)/src/main/java gnu/inet/encoding/IDNA.class       
                \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/IDNAException.class              \
+               -C $(builddir)/src/main/java gnu/inet/encoding/NFKC.class       
                \
+               -C $(builddir)/src/main/java gnu/inet/encoding/Punycode.class   
                \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/PunycodeException.class          \
+               -C $(builddir)/src/main/java gnu/inet/encoding/RFC3454.class    
                \
+               -C $(builddir)/src/main/java gnu/inet/encoding/Stringprep.class 
        \
+               -C $(builddir)/src/main/java 
gnu/inet/encoding/StringprepException.class
 
 INSTALL_TARGETS += install-jar
 install-jar:
@@ -48,10 +49,6 @@ install-jar:
 clean-local:
        rm -f $(libidn_jar_DATA)
 
-# Invoked by ../doc/java/Makefile.
-.PHONY: javadoc
-javadoc:
-       cd $(srcdir) && $(GJDOC) -d $(top_builddir)/doc/java 
gnu/inet/encoding/*.java
 endif
 
 install-data-local: $(INSTALL_TARGETS)
diff --git a/java/pom.xml.in b/java/pom.xml.in
new file mode 100644
index 0000000..5109618
--- /dev/null
+++ b/java/pom.xml.in
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.gnu.inet</groupId>
+  <artifactId>libidn</artifactId>
+  <name>GNU IDN Library</name>
+  <version>@VERSION@</version>
+
+  <description>
+    GNU Libidn is a fully documented implementation of the Stringprep,
+    Punycode and IDNA specifications. Libidn's purpose is to encode
+    and decode internationalized domain names.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.5</maven.compiler.source>
+    <maven.compiler.target>1.5</maven.compiler.target>
+    <maven.compiler.showWarnings>true</maven.compiler.showWarnings>
+    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
+  </properties>
+
+  <url>http://www.gnu.org/software/libidn/</url>
+
+  <inceptionYear>2002</inceptionYear>
+
+  <licenses>
+    <license>
+      <name>GNU Lesser General Public License version 3.0 or later</name>
+      <url>http://www.gnu.org/licenses/licenses.html</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+  <scm>
+    <connection>scm:git:git://git.savannah.gnu.org/libidn.git</connection>
+    <url>http://git.savannah.gnu.org/gitweb/?p=libidn.git</url>
+  </scm>
+
+  <organization>
+    <name>GNU</name>
+    <url>http://www.gnu.org/</url>
+  </organization>
+
+  <dependencies>
+      <dependency>
+          <groupId>com.google.code.findbugs</groupId>
+          <artifactId>annotations</artifactId>
+          <version>2.0.1</version>
+          <scope>provided</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <version>4.11</version>
+         <scope>test</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>com.google.guava</groupId>
+         <artifactId>guava</artifactId>
+         <version>14.0.1</version>
+         <scope>test</scope>
+      </dependency>
+
+      <dependency>
+         <groupId>com.google.caliper</groupId>
+         <artifactId>caliper</artifactId>
+         <version>0.5-rc1</version>
+         <scope>test</scope>
+      </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.1</version>
+      </plugin>
+
+      <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-surefire-plugin</artifactId>
+           <version>2.14.1</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+      <profile>
+         <id>caliper</id>
+         <build>
+             <plugins>
+                 <plugin>
+                     <artifactId>maven-surefire-plugin</artifactId>
+                     <configuration>
+                         <includes>
+                             <include>**/Caliper*.java</include>
+                         </includes>
+                     </configuration>
+                 </plugin>
+             </plugins>
+         </build>
+      </profile>
+  </profiles>
+
+</project>
diff --git a/java/gnu/inet/Makefile.am b/java/src/Makefile.am
similarity index 91%
copy from java/gnu/inet/Makefile.am
copy to java/src/Makefile.am
index bdad4fc..e9b83b6 100644
--- a/java/gnu/inet/Makefile.am
+++ b/java/src/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,4 +16,4 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUBDIRS = encoding
+SUBDIRS = main test util
diff --git a/java/gnu/Makefile.am b/java/src/main/Makefile.am
similarity index 92%
copy from java/gnu/Makefile.am
copy to java/src/main/Makefile.am
index e40dc86..7873a72 100644
--- a/java/gnu/Makefile.am
+++ b/java/src/main/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,4 +16,4 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUBDIRS = inet
+SUBDIRS = java
diff --git a/java/gnu/Makefile.am b/java/src/main/java/Makefile.am
similarity index 75%
copy from java/gnu/Makefile.am
copy to java/src/main/java/Makefile.am
index e40dc86..b67b723 100644
--- a/java/gnu/Makefile.am
+++ b/java/src/main/java/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,4 +16,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUBDIRS = inet
+SUBDIRS = gnu .
+INSTALL_TARGETS =
+
+if JAVA
+
+# Invoked by ../doc/java/Makefile.
+.PHONY: javadoc
+javadoc:
+       cd $(srcdir) && \
+               $(GJDOC) -d $(top_builddir)/doc/java gnu/inet/encoding/*.java
+endif
diff --git a/java/gnu/Makefile.am b/java/src/main/java/gnu/Makefile.am
similarity index 94%
copy from java/gnu/Makefile.am
copy to java/src/main/java/gnu/Makefile.am
index e40dc86..6c81dcf 100644
--- a/java/gnu/Makefile.am
+++ b/java/src/main/java/gnu/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/java/gnu/inet/Makefile.am b/java/src/main/java/gnu/inet/Makefile.am
similarity index 94%
rename from java/gnu/inet/Makefile.am
rename to java/src/main/java/gnu/inet/Makefile.am
index bdad4fc..2a78bb6 100644
--- a/java/gnu/inet/Makefile.am
+++ b/java/src/main/java/gnu/inet/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/java/gnu/inet/encoding/CombiningClass.java 
b/java/src/main/java/gnu/inet/encoding/CombiningClass.java
similarity index 100%
rename from java/gnu/inet/encoding/CombiningClass.java
rename to java/src/main/java/gnu/inet/encoding/CombiningClass.java
diff --git a/java/gnu/inet/encoding/Composition.java 
b/java/src/main/java/gnu/inet/encoding/Composition.java
similarity index 100%
rename from java/gnu/inet/encoding/Composition.java
rename to java/src/main/java/gnu/inet/encoding/Composition.java
diff --git a/java/gnu/inet/encoding/DecompositionKeys.java 
b/java/src/main/java/gnu/inet/encoding/DecompositionKeys.java
similarity index 100%
rename from java/gnu/inet/encoding/DecompositionKeys.java
rename to java/src/main/java/gnu/inet/encoding/DecompositionKeys.java
diff --git a/java/gnu/inet/encoding/DecompositionMappings.java 
b/java/src/main/java/gnu/inet/encoding/DecompositionMappings.java
similarity index 100%
rename from java/gnu/inet/encoding/DecompositionMappings.java
rename to java/src/main/java/gnu/inet/encoding/DecompositionMappings.java
diff --git a/java/gnu/inet/encoding/IDNA.java 
b/java/src/main/java/gnu/inet/encoding/IDNA.java
similarity index 96%
rename from java/gnu/inet/encoding/IDNA.java
rename to java/src/main/java/gnu/inet/encoding/IDNA.java
index c366525..9fdace1 100644
--- a/java/gnu/inet/encoding/IDNA.java
+++ b/java/src/main/java/gnu/inet/encoding/IDNA.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -54,15 +54,15 @@ public class IDNA
   public static String toASCII(String input)
     throws IDNAException
   {
-    StringBuffer o = new StringBuffer();
-    StringBuffer h = new StringBuffer();
+    StringBuilder o = new StringBuilder();
+    StringBuilder h = new StringBuilder();
 
     for (int i = 0; i < input.length(); i++) {
       char c = input.charAt(i);
       if (c == '.' || c == '\u3002' || c == '\uff0e' || c == '\uff61') {
        o.append(toASCII(h.toString(), false, true));
        o.append('.');
-       h = new StringBuffer();
+       h = new StringBuilder();
       } else {
        h.append(c);
       }
@@ -184,15 +184,15 @@ public class IDNA
    */
   public static String toUnicode(String input)
   {
-    StringBuffer o = new StringBuffer();
-    StringBuffer h = new StringBuffer();
+    StringBuilder o = new StringBuilder();
+    StringBuilder h = new StringBuilder();
 
     for (int i = 0; i < input.length(); i++) {
       char c = input.charAt(i);
       if (c == '.' || c == '\u3002' || c == '\uff0e' || c == '\uff61') {
        o.append(toUnicode(h.toString(), false, true));
        o.append(c);
-       h = new StringBuffer();
+       h = new StringBuilder();
       } else {
        h.append(c);
       }
diff --git a/java/gnu/inet/encoding/IDNAException.java 
b/java/src/main/java/gnu/inet/encoding/IDNAException.java
similarity index 96%
rename from java/gnu/inet/encoding/IDNAException.java
rename to java/src/main/java/gnu/inet/encoding/IDNAException.java
index 09e11ea..0016ee6 100644
--- a/java/gnu/inet/encoding/IDNAException.java
+++ b/java/src/main/java/gnu/inet/encoding/IDNAException.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
diff --git a/java/gnu/inet/encoding/Makefile.am 
b/java/src/main/java/gnu/inet/encoding/Makefile.am
similarity index 92%
rename from java/gnu/inet/encoding/Makefile.am
rename to java/src/main/java/gnu/inet/encoding/Makefile.am
index f526e5a..eadd866 100644
--- a/java/gnu/inet/encoding/Makefile.am
+++ b/java/src/main/java/gnu/inet/encoding/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-JAVAROOT = $(top_builddir)/java
+JAVAROOT = $(top_builddir)/java/src/main/java
 
 if JAVA
 dist_noinst_JAVA = \
diff --git a/java/gnu/inet/encoding/NFKC.java 
b/java/src/main/java/gnu/inet/encoding/NFKC.java
similarity index 94%
rename from java/gnu/inet/encoding/NFKC.java
rename to java/src/main/java/gnu/inet/encoding/NFKC.java
index 19c1cb8..d523d76 100644
--- a/java/gnu/inet/encoding/NFKC.java
+++ b/java/src/main/java/gnu/inet/encoding/NFKC.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -42,9 +42,10 @@ public class NFKC
    */
   public static String normalizeNFKC(String in)
   {
-    StringBuffer out = new StringBuffer();
+    int len = in.length();
+    StringBuilder out = new StringBuilder(len);
 
-    for (int i = 0; i < in.length(); i++) {
+    for (int i = 0; i < len; i++) {
       char code = in.charAt(i);
 
       // In Unicode 3.0, Hangul was defined as the block from U+AC00
@@ -63,7 +64,7 @@ public class NFKC
       }
     }
 
-    // Bring the stringbuffer into canonical order.
+    // Bring the StringBuilder into canonical order.
     canonicalOrdering(out);
 
     // Do the canonical composition.
@@ -155,13 +156,17 @@ public class NFKC
   }
 
   /**
-   * Rearranges characters in a stringbuffer in order to respect the
+   * Rearranges characters in a StringBuilder in order to respect the
    * canonical ordering properties.
    *
-   * @param The StringBuffer to rearrange.
+   * @param in The StringBuilder to rearrange.
    */
-  static void canonicalOrdering(StringBuffer in)
+  static void canonicalOrdering(StringBuilder in)
   {
+    if (in.length() == 0) {
+      return;
+    }
+
     boolean isOrdered = false;
 
     while (!isOrdered) {
@@ -289,7 +294,7 @@ public class NFKC
     if (SIndex < 0 || SIndex >= SCount) {
       return String.valueOf(s);
     }
-    StringBuffer result = new StringBuffer();
+    StringBuilder result = new StringBuilder();
     int L = LBase + SIndex / NCount;
     int V = VBase + (SIndex % NCount) / TCount;
     int T = TBase + SIndex % TCount;
diff --git a/java/gnu/inet/encoding/Punycode.java 
b/java/src/main/java/gnu/inet/encoding/Punycode.java
similarity index 97%
rename from java/gnu/inet/encoding/Punycode.java
rename to java/src/main/java/gnu/inet/encoding/Punycode.java
index 024a9eb..9da0860 100644
--- a/java/gnu/inet/encoding/Punycode.java
+++ b/java/src/main/java/gnu/inet/encoding/Punycode.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -62,7 +62,7 @@ public class Punycode
     int n = INITIAL_N;
     int delta = 0;
     int bias = INITIAL_BIAS;
-    StringBuffer output = new StringBuffer();
+    StringBuilder output = new StringBuilder();
 
     // Copy all basic code points to the output
     int b = 0;
@@ -150,7 +150,7 @@ public class Punycode
     int n = INITIAL_N;
     int i = 0;
     int bias = INITIAL_BIAS;
-    StringBuffer output = new StringBuffer();
+    StringBuilder output = new StringBuilder();
 
     int d = input.lastIndexOf(DELIMITER);
     if (d > 0) {
diff --git a/java/gnu/inet/encoding/PunycodeException.java 
b/java/src/main/java/gnu/inet/encoding/PunycodeException.java
similarity index 95%
rename from java/gnu/inet/encoding/PunycodeException.java
rename to java/src/main/java/gnu/inet/encoding/PunycodeException.java
index 999bf60..6425d7c 100644
--- a/java/gnu/inet/encoding/PunycodeException.java
+++ b/java/src/main/java/gnu/inet/encoding/PunycodeException.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
diff --git a/java/gnu/inet/encoding/RFC3454.java 
b/java/src/main/java/gnu/inet/encoding/RFC3454.java
similarity index 100%
rename from java/gnu/inet/encoding/RFC3454.java
rename to java/src/main/java/gnu/inet/encoding/RFC3454.java
diff --git a/java/src/main/java/gnu/inet/encoding/RangeSet.java 
b/java/src/main/java/gnu/inet/encoding/RangeSet.java
new file mode 100644
index 0000000..b4bb488
--- /dev/null
+++ b/java/src/main/java/gnu/inet/encoding/RangeSet.java
@@ -0,0 +1,404 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   Author: Stefan Larsson
+
+   This file is part of GNU Libidn.
+
+   GNU Libidn is free software: you can redistribute it and/or
+   modify it under the terms of either:
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version.
+
+   or
+
+     * the GNU General Public License as published by the Free
+       Software Foundation; either version 2 of the License, or (at
+       your option) any later version.
+
+   or both in parallel, as here.
+
+   GNU Libidn is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>. */
+
+package gnu.inet.encoding;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Set of integer ranges supporting efficient contains-checks.
+ * @author Stefan Larsson
+ */
+public final class RangeSet
+{
+  private static final RangeContainsComparator CONTAINS_COMPARATOR =
+      new RangeContainsComparator();
+
+  private final Range[] ranges;
+
+  private final Range mostSignificantGap;
+
+  // TODO Store ranges with improved cache-locality, probably int[] with 
even/odd elements being first/last
+
+  public static final class Range implements Comparable<Range>
+  {
+    private final int first;
+    private final int last;
+
+    public Range(int first, int last)
+    {
+      if (first > last) {
+       throw new IllegalArgumentException("Reversed " + first + "-" + last);
+      }
+      this.first = first;
+      this.last = last;
+    }
+
+    public Range(int single)
+    {
+      this.first = single;
+      this.last = single;
+    }
+
+    public Range(Range firstRange, Range lastRange)
+    {
+      // firstRange shouldn't start later than lastRange starts
+      if (firstRange.first > lastRange.first)
+      {
+       throw new IllegalArgumentException(firstRange + " starts later than "
+                                          + lastRange);
+      }
+
+      if (lastRange.first - firstRange.last > 1)
+      {
+       throw new IllegalArgumentException("Disjunct " + firstRange
+                                          + " - " + lastRange);
+      }
+      this.first = firstRange.first;
+      this.last = lastRange.last;
+    }
+
+    public boolean contains(final int i) {
+      return first <= i && i <= last;
+    }
+
+    /**
+     * Checks if this range completely can contain the other range.
+     * @param other other range to verify
+     * @return address@hidden true} if other completely contained by this,
+     *         otherwise address@hidden false}
+     */
+    public boolean contains(final Range other)
+    {
+      return (this.first <= other.first) && (other.last <= this.last);
+    }
+
+    @Override
+    public String toString()
+    {
+      return "[" + Integer.toHexString(first).toUpperCase(Locale.ENGLISH) + ","
+         + Integer.toHexString(last).toUpperCase(Locale.ENGLISH) + ']';
+    }
+
+    //@Override
+    public int compareTo(final Range other)
+    {
+      if (this.first < other.first)
+      {
+       return -1;
+      }
+      if (this.first > other.first)
+      {
+       return 1;
+      }
+
+      if (this.last < other.last)
+      {
+       return -1;
+      }
+      if (this.last > other.last)
+      {
+       return 1;
+      }
+
+      return 0;
+    }
+
+    @Override
+    public boolean equals(Object o)
+    {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      Range range = (Range) o;
+
+      if (first != range.first) return false;
+      if (last != range.last) return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+      return 31 * first + last;
+    }
+  }
+
+  private static class RangeContainsComparator implements Comparator<Range> {
+
+    public int compare(Range current, Range contained)
+    {
+      if (current.last < contained.first)
+      {
+       return -1;
+      }
+      if (contained.last < current.first)
+      {
+       return 1;
+      }
+      return 0;
+    }
+  }
+
+  private RangeSet(final List<Range> ranges) {
+    this.ranges = ranges.toArray(new Range[ranges.size()]);
+    this.mostSignificantGap = findMostSignificantGap(this.ranges);
+  }
+
+  /**
+   * Returns the most significant gap, or address@hidden null} if no important 
gap found.
+   * @param ranges ranges to search
+   * @return most significant gap, or address@hidden null} if no important gap 
found
+   */
+  private static Range findMostSignificantGap(final Range[] ranges)
+  {
+    if (ranges.length == 0) {
+      return new Range(0, Integer.MAX_VALUE);
+    }
+
+    final int aIdx =
+           Arrays.binarySearch(ranges, new Range('a'), CONTAINS_COMPARATOR);
+    if (aIdx >= 0)
+    {
+      // 'a' in ranges, don't even attempt to exclude smartly
+      return null;
+    }
+
+    final int insertionPoint = -(aIdx + 1);
+    if (insertionPoint == 0) {
+      return new Range(0, ranges[0].first - 1);
+    }
+    if (insertionPoint == ranges.length) {
+      return new Range(ranges[ranges.length - 1].last + 1, Integer.MAX_VALUE);
+    }
+    return new Range(ranges[insertionPoint - 1].last + 1,
+                    ranges[insertionPoint].first - 1);
+  }
+
+  public static final class Builder {
+    private final List<Range> ranges = new ArrayList<Range>();
+
+    public Builder addRange(final Range range) {
+      ranges.add(range);
+      return this;
+    }
+
+    public Builder addRanges(final Collection<Range> ranges) {
+      ranges.addAll(ranges);
+      return this;
+    }
+
+    public Builder addRanges(final char[][] ranges) {
+      for (final char[] range : ranges) {
+       if (range.length == 1) {
+         this.ranges.add(new Range(range[0]));
+       } else if (range.length == 2) {
+         this.ranges.add(new Range(range[0], range[1]));
+       } else {
+         throw new IllegalArgumentException("Unexpected range len:"
+                                            + range.length);
+       }
+      }
+      return this;
+    }
+
+    public Builder addRanges(final char[] items) {
+      for (final char item : items) {
+       this.ranges.add(new Range(item));
+      }
+      return this;
+    }
+
+    public RangeSet build() {
+      Collections.sort(ranges);
+      final List<Range> mergedRanges = mergeRanges(ranges);
+      return new RangeSet(mergedRanges);
+    }
+
+    static List<Range> mergeRanges(final List<Range> ranges)
+    {
+      if (ranges.isEmpty())
+      {
+       return Collections.emptyList();
+      }
+
+      final List<Range> result = new ArrayList<Range>();
+      final Iterator<Range> it = ranges.iterator();
+
+      Range leftRange = it.next();
+      List<Range> merged = Collections.singletonList(leftRange);
+      while (it.hasNext())
+      {
+       // merge ranges as long as they're adjacent/overlapping
+       while (merged.size() == 1 && it.hasNext())
+       {
+         leftRange = merged.get(0);
+         Range rightRange = it.next();
+         merged = mergeRanges(leftRange, rightRange);
+       }
+       // when ranges weren't merge-able, add all but last, merge against last
+       if (merged.size() > 1)
+       {
+         result.addAll(merged.subList(0, merged.size() - 1));
+         merged = Collections.singletonList(merged.get(merged.size() - 1));
+       }
+      }
+      result.addAll(merged);
+      return result;
+    }
+
+    static List<Range> mergeRanges(Range leftRange, Range rightRange)
+    {
+      if (leftRange.last + 1 >= rightRange.first) {
+       final int last = Math.max(rightRange.last, leftRange.last);
+       return Collections.singletonList(new Range(leftRange.first, last));
+      } else {
+       final List<Range> result = new ArrayList<Range>(2);
+       result.add(leftRange);
+       result.add(rightRange);
+       return result;
+      }
+    }
+  }
+
+  public static Builder builder() {
+    return new Builder();
+  }
+
+  public boolean contains(final int i)
+  {
+    if (mostSignificantGap != null && mostSignificantGap.contains(i)) {
+      return false;
+    }
+
+    final Range searchRange = new Range(i);
+    int idx = Arrays.binarySearch(ranges, searchRange, CONTAINS_COMPARATOR);
+    return idx >= 0;
+  }
+
+  public boolean containsAnyCodePoint(final CharSequence text) {
+    final Range inputRange = createTextRange(text);
+    return containsAnyCodePoint(text, inputRange);
+  }
+
+  public boolean containsAnyCodePoint(final CharSequence text,
+                                     final Range inputRange) {
+    final int len = text.length();
+    if (len == 0)
+    {
+      return false;
+    }
+
+    if (mostSignificantGap != null
+       && mostSignificantGap.contains(inputRange.first)
+       && mostSignificantGap.contains(inputRange.last)) {
+      return false;
+    }
+
+    // if found, returns the index, otherwise "-insertionPoint - 1"
+    final int idxEnd =
+           Arrays.binarySearch(ranges, new Range(inputRange.last), 
CONTAINS_COMPARATOR);
+    // search for start in "head" range only (likely small)
+    final int startFromIdx = 0;
+    final int startEndIdx = idxEnd >= 0 ? idxEnd + 1 : -(idxEnd + 1);
+    final int idxStart =
+           Arrays.binarySearch(ranges, startFromIdx, startEndIdx,
+                               new Range(inputRange.first), 
CONTAINS_COMPARATOR);
+
+    // If whole range in text outside same non-contained range, won't be found
+    // If whole range in text inside single contained range, must match
+    if (idxStart == idxEnd)
+    {
+      return idxStart >= 0;
+    }
+
+    // if start or end inside contained range, match
+    if (idxStart >= 0 || idxEnd >= 0)
+    {
+      return true;
+    }
+
+    // text spans across multiple ranges of set, need to search individual 
chars
+    final int searchStart = -idxStart + 1;
+    final int searchEnd = -idxEnd + 1;
+
+    for (int i = 0; i < len; )
+    {
+      final int cp = Character.codePointAt(text, i);
+      i += Character.charCount(cp);
+      final int idx = Arrays.binarySearch(ranges, searchStart, searchEnd, new 
Range(cp), CONTAINS_COMPARATOR);
+      if (idx > 0)
+      {
+       return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Returns the range of the input or address@hidden all-inclusive range} if 
input is empty
+   * @param text input text
+   * @return range of input, or address@hidden all-inclusive} if empty input
+   */
+  public static Range createTextRange(final CharSequence text)
+  {
+    final int len = text.length();
+    if (len == 0) {
+      return new Range(Integer.MIN_VALUE, Integer.MAX_VALUE);
+    }
+
+    int minCodePoint = Integer.MAX_VALUE;
+    int maxCodePoint = Integer.MIN_VALUE;
+    for (int i = 0; i < len; )
+    {
+      final int cp = Character.codePointAt(text, i);
+      minCodePoint = Math.min(minCodePoint, cp);
+      maxCodePoint = Math.max(maxCodePoint, cp);
+      i += Character.charCount(cp);
+    }
+    return new Range(minCodePoint, maxCodePoint);
+  }
+
+  @Override
+  public String toString()
+  {
+    return "RangeSet{" +
+           "ranges=" + Arrays.asList(ranges) +
+           ", mostSignificantGap=" + mostSignificantGap +
+           '}';
+  }
+}
diff --git a/java/gnu/inet/encoding/Stringprep.java 
b/java/src/main/java/gnu/inet/encoding/Stringprep.java
similarity index 55%
rename from java/gnu/inet/encoding/Stringprep.java
rename to java/src/main/java/gnu/inet/encoding/Stringprep.java
index 8f12729..947a29e 100644
--- a/java/gnu/inet/encoding/Stringprep.java
+++ b/java/src/main/java/gnu/inet/encoding/Stringprep.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -29,6 +29,8 @@
 
 package gnu.inet.encoding;
 
+import java.util.Arrays;
+
 /**
  * This class offers static methods for preparing internationalized
  * strings. It supports the following stringprep profiles:
@@ -41,6 +43,92 @@ package gnu.inet.encoding;
  */
 public class Stringprep
 {
+  private static final RangeSet.Range[] NODEPREP_PASSTHROUGH_RANGES =
+         new RangeSet.Range[] { new RangeSet.Range(0x5B, 0x7E),
+                                new RangeSet.Range(0x30, 0x39),
+                                new RangeSet.Range(0x28, 0x2E)};
+
+  private static final RangeSet.Range[] NAMEPREP_PASSTHROUGH_RANGES =
+         new RangeSet.Range[] { new RangeSet.Range(0x5B, 0x7F),
+                                new RangeSet.Range(0x00, 0x40)};
+
+  private static final RangeSet.Range[] RESOURCEPREP_PASSTHROUGH_RANGES =
+         new RangeSet.Range[] { new RangeSet.Range(0x20, 0x7E)};
+
+
+  private static final RangeSet RANGE_A1 =
+         RangeSet.builder().addRanges(RFC3454.A1)
+                 .build();
+
+  private static final RangeSet RANGE_B1 =
+         RangeSet.builder().addRanges(RFC3454.B1)
+                 .build();
+
+  private static final RangeSet RANGE_D1 =
+         RangeSet.builder().addRanges(RFC3454.D1)
+                 .build();
+
+  private static final RangeSet RANGE_D2 =
+         RangeSet.builder().addRanges(RFC3454.D2)
+                 .build();
+
+
+  private static final RangeSet RANGE_C3_to_C8_C12_C22 =
+         RangeSet.builder().addRanges(RFC3454.C12)
+                 .addRanges(RFC3454.C22)
+                 .addRanges(RFC3454.C3)
+                 .addRanges(RFC3454.C4)
+                 .addRanges(RFC3454.C5)
+                 .addRanges(RFC3454.C6)
+                 .addRanges(RFC3454.C7)
+                 .addRanges(RFC3454.C8)
+                 // TODO Add C9 table now, proper unicode support now
+                 // Temporary rejection of all "unsupported" in java 1.4
+                 .addRange(new RangeSet.Range(0xffff, 0x10ffff))
+                 .build();
+
+  /**
+   * Characters prohibited by RFC3920 nodeprep that aren't defined as
+   * part of the RFC3454 tables.
+   */
+  private static final char [] RFC3920_NODEPREP_PROHIBIT = new char [] {
+         '\u0022', '\u0026', '\'',     '\u002F',
+         '\u003A', '\u003C', '\u003E', '\u0040'
+  };
+
+  private static final RangeSet RANGE_C3_TO_C8_C11_12_21_22_NP_PROHIB =
+         RangeSet.builder().addRanges(RFC3454.C3)
+                 .addRanges(RFC3454.C4)
+                 .addRanges(RFC3454.C5)
+                 .addRanges(RFC3454.C6)
+                 .addRanges(RFC3454.C7)
+                 .addRanges(RFC3454.C8)
+                 .addRanges(RFC3454.C11)
+                 .addRanges(RFC3454.C12)
+                 .addRanges(RFC3454.C21)
+                 .addRanges(RFC3454.C22)
+                 .addRanges(RFC3920_NODEPREP_PROHIBIT)
+                 // TODO Add C9 table now, proper unicode support now
+                 // Temporary rejection of all "unsupported" in java 1.4
+                 .addRange(new RangeSet.Range(0xffff, 0x10ffff))
+                 .build();
+
+  private static final RangeSet RANGE_C3_to_C8_C12_C21_C22 =
+         RangeSet.builder().addRanges(RFC3454.C12)
+                 .addRanges(RFC3454.C21)
+                 .addRanges(RFC3454.C22)
+                 .addRanges(RFC3454.C3)
+                 .addRanges(RFC3454.C4)
+                 .addRanges(RFC3454.C5)
+                 .addRanges(RFC3454.C6)
+                 .addRanges(RFC3454.C7)
+                 .addRanges(RFC3454.C8)
+                 // TODO Add C9 table now, proper unicode support now
+                 // Temporary rejection of all "unsupported" in java 1.4
+                 .addRange(new RangeSet.Range(0xffff, 0x10ffff))
+                 .build();
+
+
   /**
    * Preps a name according to the Stringprep profile defined in
    * RFC3491. Unassigned code points are not allowed.
@@ -78,35 +166,32 @@ public class Stringprep
       throw new NullPointerException();
     }
 
-    StringBuffer s = new StringBuffer(input);
-
-    if (!allowUnassigned && contains(s, RFC3454.A1)) {
+    final RangeSet.Range inputRange = RangeSet.createTextRange(input);
+    if (onlyPassThrough(NAMEPREP_PASSTHROUGH_RANGES, inputRange)) {
+      return input;
+    }
+    if (!allowUnassigned && RANGE_A1.containsAnyCodePoint(input, inputRange)) {
       throw new StringprepException(StringprepException.CONTAINS_UNASSIGNED);
     }
 
-    filter(s, RFC3454.B1);
+    StringBuilder s = new StringBuilder(input);
+
+    filter(s, RANGE_B1);
     map(s, RFC3454.B2search, RFC3454.B2replace);
 
-    s = new StringBuffer(NFKC.normalizeNFKC(s.toString()));
+    s = new StringBuilder(NFKC.normalizeNFKC(s.toString()));
+    final RangeSet.Range normalizedRange = RangeSet.createTextRange(s);
     // B.3 is only needed if NFKC is not used, right?
     // map(s, RFC3454.B3search, RFC3454.B3replace);
-
-    if (contains(s, RFC3454.C12) ||
-       contains(s, RFC3454.C22) ||
-       contains(s, RFC3454.C3) ||
-       contains(s, RFC3454.C4) ||
-       contains(s, RFC3454.C5) ||
-       contains(s, RFC3454.C6) ||
-       contains(s, RFC3454.C7) ||
-       contains(s, RFC3454.C8)) {
+    if (RANGE_C3_to_C8_C12_C22.containsAnyCodePoint(s, normalizedRange)) {
       // Table C.9 only contains code points > 0xFFFF which Java
       // doesn't handle
       throw new StringprepException(StringprepException.CONTAINS_PROHIBITED);
     }
 
     // Bidi handling
-    boolean r = contains(s, RFC3454.D1);
-    boolean l = contains(s, RFC3454.D2);
+    boolean r = RANGE_D1.containsAnyCodePoint(s, normalizedRange);
+    boolean l = RANGE_D2.containsAnyCodePoint(s, normalizedRange);
 
     // RFC 3454, section 6, requirement 1: already handled above (table C.8)
 
@@ -117,8 +202,8 @@ public class Stringprep
 
     // RFC 3454, section 6, requirement 3
     if (r) {
-      if (!contains(s.charAt(0), RFC3454.D1) ||
-         !contains(s.charAt(s.length()-1), RFC3454.D1)) {
+      if (!RANGE_D1.contains(s.charAt(0)) ||
+         !RANGE_D1.contains(s.charAt(s.length()-1))) {
        throw new StringprepException(StringprepException.BIDI_LTRAL);
       }
     }
@@ -127,15 +212,6 @@ public class Stringprep
   }
 
   /**
-   * Characters prohibited by RFC3920 nodeprep that aren't defined as
-   * part of the RFC3454 tables.
-   */
-  private static final char [] RFC3920_NODEPREP_PROHIBIT = new char [] {
-    '\u0022', '\u0026', '\'',     '\u002F',
-    '\u003A', '\u003C', '\u003E', '\u0040'
-  };
-
-  /**
    * Preps a node name according to the Stringprep profile defined in
    * RFC3920. Unassigned code points are not allowed.
    *
@@ -172,36 +248,29 @@ public class Stringprep
       throw new NullPointerException();
     }
 
-    StringBuffer s = new StringBuffer(input);
-
-    if (!allowUnassigned && contains(s, RFC3454.A1)) {
+    final RangeSet.Range inputRange = RangeSet.createTextRange(input);
+    if (onlyPassThrough(NODEPREP_PASSTHROUGH_RANGES, inputRange)) {
+      return input;
+    }
+    if (!allowUnassigned && RANGE_A1.containsAnyCodePoint(input, inputRange)) {
       throw new StringprepException(StringprepException.CONTAINS_UNASSIGNED);
     }
 
-    filter(s, RFC3454.B1);
+    StringBuilder s = new StringBuilder(input);
+
+    filter(s, RANGE_B1);
     map(s, RFC3454.B2search, RFC3454.B2replace);
 
-    s = new StringBuffer(NFKC.normalizeNFKC(s.toString()));
-    
-    if (contains(s, RFC3454.C11) ||
-       contains(s, RFC3454.C12) ||
-       contains(s, RFC3454.C21) ||
-       contains(s, RFC3454.C22) ||
-       contains(s, RFC3454.C3) ||
-       contains(s, RFC3454.C4) ||
-       contains(s, RFC3454.C5) ||
-       contains(s, RFC3454.C6) ||
-       contains(s, RFC3454.C7) ||
-       contains(s, RFC3454.C8) ||
-       contains(s, RFC3920_NODEPREP_PROHIBIT)) {                           
-      // Table C.9 only contains code points > 0xFFFF which Java
-      // doesn't handle
+    s = new StringBuilder(NFKC.normalizeNFKC(s.toString()));
+    final RangeSet.Range normalizedRange = RangeSet.createTextRange(s);
+    if (RANGE_C3_TO_C8_C11_12_21_22_NP_PROHIB.containsAnyCodePoint(s, 
normalizedRange))
+    {
       throw new StringprepException(StringprepException.CONTAINS_PROHIBITED);
     }
 
     // Bidi handling
-    boolean r = contains(s, RFC3454.D1);
-    boolean l = contains(s, RFC3454.D2);
+    boolean r = RANGE_D1.containsAnyCodePoint(s, normalizedRange);
+    boolean l = RANGE_D2.containsAnyCodePoint(s, normalizedRange);
 
     // RFC 3454, section 6, requirement 1: already handled above (table C.8)
 
@@ -209,15 +278,15 @@ public class Stringprep
     if (r && l) {
       throw new        StringprepException(StringprepException.BIDI_BOTHRAL);
     }
-    
+
     // RFC 3454, section 6, requirement 3
     if (r) {
-      if (!contains(s.charAt(0), RFC3454.D1) ||
-         !contains(s.charAt(s.length() - 1), RFC3454.D1)) {
+      if (!RANGE_D1.contains(s.charAt(0)) ||
+         !RANGE_D1.contains(s.charAt(s.length() - 1))) {
        throw new StringprepException(StringprepException.BIDI_LTRAL);
       }
     }
-    
+
     return s.toString();
   }
 
@@ -258,36 +327,34 @@ public class Stringprep
       throw new NullPointerException();
     }
 
-    StringBuffer s = new StringBuffer(input);
-    
-    if (!allowUnassigned && contains(s, RFC3454.A1)) {
+    final RangeSet.Range inputRange = RangeSet.createTextRange(input);
+    if (onlyPassThrough(RESOURCEPREP_PASSTHROUGH_RANGES, inputRange)) {
+      return input;
+    }
+    if (!allowUnassigned && RANGE_A1.containsAnyCodePoint(input)) {
       throw new StringprepException(StringprepException.CONTAINS_UNASSIGNED);
     }
 
-    filter(s, RFC3454.B1);
-    
-    s = new StringBuffer(NFKC.normalizeNFKC(s.toString()));
-    
-    if (contains(s, RFC3454.C12) ||
-       contains(s, RFC3454.C21) ||
-       contains(s, RFC3454.C22) ||
-       contains(s, RFC3454.C3) ||
-       contains(s, RFC3454.C4) ||
-       contains(s, RFC3454.C5) ||
-       contains(s, RFC3454.C6) ||
-       contains(s, RFC3454.C7) ||
-       contains(s, RFC3454.C8)) {
+    StringBuilder s = new StringBuilder(input);
+
+    filter(s, RANGE_B1);
+
+    s = new StringBuilder(NFKC.normalizeNFKC(s.toString()));
+    final RangeSet.Range normalizedRange = RangeSet.createTextRange(s);
+
+    if (RANGE_C3_to_C8_C12_C21_C22.containsAnyCodePoint(s, normalizedRange)) {
       // Table C.9 only contains code points > 0xFFFF which Java
       // doesn't handle
+
       throw new StringprepException(StringprepException.CONTAINS_PROHIBITED);
     }
-    
+
     // Bidi handling
-    boolean r = contains(s, RFC3454.D1);
-    boolean l = contains(s, RFC3454.D2);
-    
+    boolean r = RANGE_D1.containsAnyCodePoint(s, normalizedRange);
+    boolean l = RANGE_D2.containsAnyCodePoint(s, normalizedRange);
+
     // RFC 3454, section 6, requirement 1: already handled above (table C.8)
-    
+
     // RFC 3454, section 6, requirement 2
     if (r && l) {
       throw new        StringprepException(StringprepException.BIDI_BOTHRAL);
@@ -295,135 +362,45 @@ public class Stringprep
 
     // RFC 3454, section 6, requirement 3
     if (r) {
-      if (!contains(s.charAt(0), RFC3454.D1) ||
-         !contains(s.charAt(s.length() - 1), RFC3454.D1)) {
+      if (!RANGE_D1.contains(s.charAt(0)) ||
+         !RANGE_D1.contains(s.charAt(s.length() - 1))) {
        throw new StringprepException(StringprepException.BIDI_LTRAL);
       }
     }
-    
-    return s.toString();
-  }
-
-  static boolean contains(StringBuffer s, char[] p)
-  {
-    for (int i = 0; i < p.length; i++) {
-      char c = p[i];
-      for (int j = 0; j < s.length(); j++) {
-       if (c == s.charAt(j)) {
-         return true;
-       }
-      }
-    }
-    return false;
-  }
 
-  static boolean contains(StringBuffer s, char[][] p)
-  {
-    for (int i = 0; i < p.length; i++) {
-      char[] r = p[i];
-      if (1 == r.length) {
-       char c = r[0];
-       for (int j = 0; j < s.length(); j++) {
-         if (c == s.charAt(j)) {
-           return true;
-         }
-       }
-      } else if (2 == r.length) {
-       char f = r[0];
-       char t = r[1];
-       for (int j = 0; j < s.length(); j++) {
-         if (f <= s.charAt(j) && t >= s.charAt(j)) {
-           return true;
-         }
-       }
-      }
-    }
-    return false;
+    return s.toString();
   }
 
-  static boolean contains(char c, char[][] p)
-  {
-    for (int i = 0; i < p.length; i++) {
-      char[] r = p[i];
-      if (1 == r.length) {
-       if (c == r[0]) {
-         return true;
-       }
-      } else if (2 == r.length) {
-       char f = r[0];
-       char t = r[1];
-       if (f <= c && t >= c) {
-         return true;
-       }
+  private static boolean onlyPassThrough(final RangeSet.Range[] passThroughs,
+                                        final RangeSet.Range inputRange) {
+    for (final RangeSet.Range passThrough : passThroughs) {
+      if (passThrough.contains(inputRange)) {
+       return true;
       }
     }
     return false;
   }
 
-  static void filter(StringBuffer s, char[] f)
-  {
-    for (int i = 0; i < f.length; i++) {
-      char c = f[i];
-
-      int j = 0;
-      while (j < s.length()) {
-       if (c == s.charAt(j)) {
-         s.deleteCharAt(j);
-       } else {
-         j++;
-       }
-      }
-    }
-  }
-
-  static void filter(StringBuffer s, char[][] f)
+  static void filter(StringBuilder s, RangeSet f)
   {
-    for (int i = 0; i < f.length; i++) {
-      char[] r = f[i];
-
-      if (1 == r.length) {
-       char c = r[0];
-
-       int j = 0;
-       while (j < s.length()) {
-         if (c == s.charAt(j)) {
-           s.deleteCharAt(j);
-         } else {
-           j++;
-         }
-       }
-      } else if (2 == r.length) {
-       char from = r[0];
-       char to = r[1];
-
-       int j = 0;
-       while (j < s.length()) {
-         if (from <= s.charAt(j) && to >= s.charAt(j)) {
-           s.deleteCharAt(j);
-         } else {
-           j++;
-         }
-       }
+    for (int j = 0; j < s.length(); ) {
+      if (f.contains(s.charAt(j))) {
+       s.deleteCharAt(j);
+      } else {
+       j++;
       }
     }
   }
 
-  static void map(StringBuffer s, char[] search, String[] replace)
+  static void map(StringBuilder s, char[] search, String[] replace)
   {
-    for (int i = 0; i < search.length; i++) {
-      char c = search[i];
-
-      int j = 0;
-      while (j < s.length()) {
-       if (c == s.charAt(j)) {
-         s.deleteCharAt(j);
-         if (null != replace[i]) {
-           s.insert(j, replace[i]);
-           j += replace[i].length()-1;
-         }
-       } else {
-         j++;
-       }
+    for (int i = 0; i < s.length(); i++) {
+      char c = s.charAt(i);
+      int mapIndex = Arrays.binarySearch(search, c);
+      if (mapIndex >= 0) {
+       String replacement = replace[mapIndex];
+       s.replace(i, i + 1, replacement);
+       i += replacement.length() - 1;
       }
     }
   }
diff --git a/java/gnu/inet/encoding/StringprepException.java 
b/java/src/main/java/gnu/inet/encoding/StringprepException.java
similarity index 96%
rename from java/gnu/inet/encoding/StringprepException.java
rename to java/src/main/java/gnu/inet/encoding/StringprepException.java
index 5880ebc..9b054aa 100644
--- a/java/gnu/inet/encoding/StringprepException.java
+++ b/java/src/main/java/gnu/inet/encoding/StringprepException.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
diff --git a/java/gnu/Makefile.am b/java/src/test/Makefile.am
similarity index 92%
copy from java/gnu/Makefile.am
copy to java/src/test/Makefile.am
index e40dc86..7873a72 100644
--- a/java/gnu/Makefile.am
+++ b/java/src/test/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,4 +16,4 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUBDIRS = inet
+SUBDIRS = java
diff --git a/java/misc/Makefile.am b/java/src/test/java/Makefile.am
similarity index 82%
copy from java/misc/Makefile.am
copy to java/src/test/java/Makefile.am
index 3ce0c3e..45e6958 100644
--- a/java/misc/Makefile.am
+++ b/java/src/test/java/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012  Free Software Foundation
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
 #
 # This file is part of GNU Libidn.
 #
@@ -16,13 +16,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-JAVAROOT = $(top_builddir)/java/misc
+JAVAROOT = $(top_builddir)/java/src/test/java
 AM_JAVACFLAGS = -classpath 
$(top_builddir)/java/libidn-$(VERSION).jar:$(top_srcdir)/java/libidn-$(VERSION).jar
 
 if JAVA
-dist_noinst_JAVA = \
-       GenerateRFC3454.java \
-       GenerateNFKC.java \
-       TestIDNA.java \
-       TestNFKC.java
+dist_noinst_JAVA = 
+
 endif
diff --git a/java/src/test/java/gnu/inet/encoding/RangeSetTest.java 
b/java/src/test/java/gnu/inet/encoding/RangeSetTest.java
new file mode 100644
index 0000000..9f1936e
--- /dev/null
+++ b/java/src/test/java/gnu/inet/encoding/RangeSetTest.java
@@ -0,0 +1,190 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   Author: Stefan Larsson
+
+   This file is part of GNU Libidn.
+
+   GNU Libidn is free software: you can redistribute it and/or
+   modify it under the terms of either:
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version.
+
+   or
+
+     * the GNU General Public License as published by the Free
+       Software Foundation; either version 2 of the License, or (at
+       your option) any later version.
+
+   or both in parallel, as here.
+
+   GNU Libidn is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>. */
+
+package gnu.inet.encoding;
+
+import com.google.common.collect.ImmutableList;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * @author Stefan Larsson
+ */
+public class RangeSetTest
+{
+  @Test
+  public void testEmptyRangeSet()
+  {
+    final RangeSet rangeSet;
+    final RangeSet.Builder builder = RangeSet.builder();
+    rangeSet = builder.build();
+
+    Assert.assertFalse("range set misses any number",
+           rangeSet.contains(42));
+  }
+
+
+  @Test
+  public void testSingleItemRange()
+  {
+    final RangeSet rangeSet;
+    final RangeSet.Builder builder = RangeSet.builder();
+    builder.addRange(new RangeSet.Range(42));
+    rangeSet = builder.build();
+
+    Assert.assertTrue("single-number range set contains number",
+                     rangeSet.contains(42));
+    Assert.assertFalse("single-number range set misses other number",
+                      rangeSet.contains(17));
+  }
+
+  @Test
+  public void testMultiItemRange()
+  {
+    final RangeSet rangeSet;
+    final RangeSet.Builder builder = RangeSet.builder();
+    builder.addRange(new RangeSet.Range(10, 15));
+    rangeSet = builder.build();
+
+    Assert.assertTrue("[10,15] contains 10", rangeSet.contains(10));
+    Assert.assertTrue("[10,15] contains 13", rangeSet.contains(13));
+    Assert.assertTrue("[10,15] contains 15", rangeSet.contains(15));
+    Assert.assertFalse("[10,15] doesn't contain 9", rangeSet.contains(9));
+    Assert.assertFalse("[10,15] doesn't contain 16", rangeSet.contains(16));
+  }
+
+  @Test
+  public void testAdjacentMultiItemRanges()
+  {
+    final RangeSet rangeSet;
+    final RangeSet.Builder builder = RangeSet.builder();
+    builder.addRange(new RangeSet.Range(10, 12));
+    builder.addRange(new RangeSet.Range(13, 15));
+    rangeSet = builder.build();
+
+    Assert.assertTrue("[10,15] contains 10", rangeSet.contains(10));
+    Assert.assertTrue("[10,15] contains 13", rangeSet.contains(13));
+    Assert.assertTrue("[10,15] contains 15", rangeSet.contains(15));
+    Assert.assertFalse("[10,15] doesn't contain 9", rangeSet.contains(9));
+    Assert.assertFalse("[10,15] doesn't contain 16", rangeSet.contains(16));
+  }
+
+  @Test
+  public void testOverlappingMultiItemRanges()
+  {
+    final RangeSet rangeSet;
+    final RangeSet.Builder builder = RangeSet.builder();
+    builder.addRange(new RangeSet.Range(10, 13));
+    builder.addRange(new RangeSet.Range(13, 15));
+    rangeSet = builder.build();
+
+    Assert.assertTrue("[10,15] contains 10", rangeSet.contains(10));
+    Assert.assertTrue("[10,15] contains 13", rangeSet.contains(13));
+    Assert.assertTrue("[10,15] contains 15", rangeSet.contains(15));
+    Assert.assertFalse("[10,15] doesn't contain 9", rangeSet.contains(9));
+    Assert.assertFalse("[10,15] doesn't contain 16", rangeSet.contains(16));
+  }
+
+  @Test
+  public void testSeparatedMultiItemRanges()
+  {
+    final RangeSet rangeSet;
+    final RangeSet.Builder builder = RangeSet.builder();
+    builder.addRange(new RangeSet.Range(13, 15));
+    builder.addRange(new RangeSet.Range(10, 11));
+    rangeSet = builder.build();
+
+    Assert.assertTrue("[10,11][13,15] contains 10", rangeSet.contains(10));
+    Assert.assertTrue("[10,11][13,15] contains 11", rangeSet.contains(11));
+    Assert.assertTrue("[10,11][13,15] contains 13", rangeSet.contains(13));
+    Assert.assertTrue("[10,11][13,15] contains 15", rangeSet.contains(15));
+    Assert.assertFalse("[10,11][13,15] doesn't contain 9", 
rangeSet.contains(9));
+    Assert.assertFalse("[10,11][13,15] doesn't contain 12", 
rangeSet.contains(12));
+    Assert.assertFalse("[10,11][13,15] doesn't contain 16", 
rangeSet.contains(16));
+  }
+
+  @Test
+  public void testEmptyBuilder()
+  {
+    final List<RangeSet.Range> merged =
+           RangeSet.Builder.mergeRanges(ImmutableList.<RangeSet.Range>of());
+    Assert.assertTrue("empty merged is empty", merged.isEmpty());
+  }
+
+  @Test
+  public void testSingleRangeBuilder()
+  {
+    final RangeSet.Range range = new RangeSet.Range(1, 2);
+    final List<RangeSet.Range> merged =
+           
RangeSet.Builder.mergeRanges(ImmutableList.<RangeSet.Range>of(range));
+    Assert.assertEquals("single range stays", ImmutableList.of(range), merged);
+  }
+
+  @Test
+  public void testAdjacentRangesBuilder()
+  {
+    final RangeSet.Range range1 = new RangeSet.Range(1, 2);
+    final RangeSet.Range range2 = new RangeSet.Range(3, 4);
+    final List<RangeSet.Range> merged =
+           RangeSet.Builder.mergeRanges(
+                   ImmutableList.<RangeSet.Range>of(range1, range2));
+    Assert.assertEquals("adjacent merged ranges",
+                       ImmutableList.of(new RangeSet.Range(1, 4)), merged);
+  }
+
+  @Test
+  public void testSeparatedRangesBuilder()
+  {
+    final RangeSet.Range range1 = new RangeSet.Range(1, 2);
+    final RangeSet.Range range2 = new RangeSet.Range(4, 5);
+    final List<RangeSet.Range> merged =
+           RangeSet.Builder.mergeRanges(
+                   ImmutableList.<RangeSet.Range>of(range1, range2));
+    Assert.assertEquals("adjacent merged ranges",
+           ImmutableList.of(range1, range2), merged);
+  }
+
+  @Test
+  public void testMergeMultipleRangesBuilder()
+  {
+    final RangeSet.Range range1 = new RangeSet.Range(1, 2);
+    final RangeSet.Range range2 = new RangeSet.Range(3, 5);
+    final RangeSet.Range range3 = new RangeSet.Range(4, 8);
+    final RangeSet.Range range4 = new RangeSet.Range(5, 7);
+    final List<RangeSet.Range> merged =
+           RangeSet.Builder.mergeRanges(
+                   ImmutableList.<RangeSet.Range>of(range1, range2,
+                                                    range3, range4));
+    Assert.assertEquals("multiple ranges merged to one",
+           ImmutableList.of(new RangeSet.Range(1, 8)), merged);
+  }
+
+}
diff --git a/java/src/test/java/gnu/inet/encoding/StringprepTest.java 
b/java/src/test/java/gnu/inet/encoding/StringprepTest.java
new file mode 100644
index 0000000..43bf16e
--- /dev/null
+++ b/java/src/test/java/gnu/inet/encoding/StringprepTest.java
@@ -0,0 +1,204 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   Author: Stefan Larsson
+
+   This file is part of GNU Libidn.
+
+   GNU Libidn is free software: you can redistribute it and/or
+   modify it under the terms of either:
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version.
+
+   or
+
+     * the GNU General Public License as published by the Free
+       Software Foundation; either version 2 of the License, or (at
+       your option) any later version.
+
+   or both in parallel, as here.
+
+   GNU Libidn is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>. */
+
+package gnu.inet.encoding;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Stringprep unit tests converted from C version.
+ * @author Stefan Larsson
+ */
+public class StringprepTest
+{
+  private enum Profile {
+    NODE_PREP
+      {
+       @Override
+       String prep(String in, boolean allowUnassigned) throws 
StringprepException
+       {
+         return Stringprep.nodeprep(in, allowUnassigned);
+       }
+      },
+    NAME_PREP
+      {
+       @Override
+       String prep(String in, boolean allowUnassigned) throws 
StringprepException
+       {
+         return Stringprep.nameprep(in, allowUnassigned);
+       }
+      },
+    RESOURCE_PREP
+      {
+       @Override
+       String prep(String in, boolean allowUnassigned) throws 
StringprepException
+       {
+         return Stringprep.resourceprep(in, allowUnassigned);
+       }
+      }
+    ;
+
+    abstract String prep(String in, boolean allowUnassigned) throws 
StringprepException;
+  }
+
+  private static class Check {
+    private final String comment;
+    private final String in;
+    private final String out;
+    private final Profile profile;
+    private final boolean allowUnassigned;
+    private final boolean expectException;
+
+    private Check(final String comment,
+                 final String in,
+                 final String out,
+                 final Profile profile,
+                 final boolean allowUnassigned,
+                 final boolean expectException)
+    {
+      this.comment = comment;
+      this.in = in;
+      this.out = out;
+      this.profile = profile;
+      this.allowUnassigned = allowUnassigned;
+      this.expectException = expectException;
+    }
+
+    private Check(final String comment,
+                 final String in, final String out)
+    {
+      this.comment = comment;
+      this.in = in;
+      this.out = out;
+      this.profile = Profile.NAME_PREP;
+      this.allowUnassigned = true; // C tests allow unassigned CPs by default
+      this.expectException = false;
+    }
+
+    @Override
+    public String toString()
+    {
+      return "Check{" +
+             "comment='" + comment + '\'' +
+             ", in='" + in + '\'' +
+             ", out='" + out + '\'' +
+             ", profile=" + profile +
+             ", allowUnassigned=" + allowUnassigned +
+             ", expectException=" + expectException +
+             '}';
+    }
+  }
+
+  // test cases converted to Java from tst_stringprep.c
+  private final Check[] checks = new Check[] {
+         new Check("Map to nothing", 
"foo\u00ad\u034f\u1806\u180bbar\u200b\u2060baz\ufe00\ufe08\ufe0f\ufeff", 
"foobarbaz"),
+         new Check("Case folding ASCII U+0043 U+0041 U+0046 U+0045", "CAFE", 
"cafe"),
+         new Check("Case folding 8bit U+00DF (german sharp s)", "\u00df", 
"ss"),
+         new Check("Case folding U+0130 (turkish capital I with dot)", 
"\u0130", "i\u0307"),
+         new Check("Case folding multibyte U+0143 U+037A", "\u0143\u037a", 
"\u0144 \u03b9"),
+// Code points outside BMP not supported by Java impl yet
+//       new Check("Case folding U+2121 U+33C6 U+1D7BB", 
"\u2121\u33c6\ud835\udfbb", "telc\u2215kg\u03c3"),
+         new Check("Normalization of U+006a U+030c U+00A0 U+00AA", 
"j\u030c\u00a0\u00aa", "\u01f0 a"),
+         new Check("Case folding U+1FB7 and normalization", "\u1fb7", 
"\u1fb6\u03b9"),
+         new Check("Self-reverting case folding U+01F0 and normalization", 
"\u01f0", "\u01f0"),
+         new Check("Self-reverting case folding U+0390 and normalization", 
"\u0390", "\u0390"),
+         new Check("Self-reverting case folding U+03B0 and normalization", 
"\u03b0", "\u03b0"),
+         new Check("Self-reverting case folding U+1E96 and normalization", 
"\u1e96", "\u1e96"),
+         new Check("Self-reverting case folding U+1F56 and normalization", 
"\u1f56", "\u1f56"),
+         new Check("ASCII space character U+0020", " ", " "),
+         new Check("Non-ASCII 8bit space character U+00A0", "\u00a0", " "),
+         new Check("Non-ASCII multibyte space character U+1680", "\u1680", "", 
Profile.NAME_PREP, true, true),
+         new Check("Non-ASCII multibyte space character U+2000", "\u2000", " 
"),
+         new Check("Zero Width Space U+200b", "\u200b", ""),
+         new Check("Non-ASCII multibyte space character U+3000", "\u3000", " 
"),
+         new Check("ASCII control characters U+0010 U+007F", "\u0010\u007f", 
"\u0010\u007f"),
+         new Check("Non-ASCII 8bit control character U+0085", "\u0085", "", 
Profile.NAME_PREP, true, true),
+         new Check("Non-ASCII multibyte control character U+180E", "\u180e", 
"", Profile.NAME_PREP, true, true),
+         new Check("Zero Width No-Break Space U+FEFF", "\ufeff", ""),
+         new Check("Non-ASCII control character U+1D175", "\ud834\udd75", "", 
Profile.NAME_PREP, true, true),
+         new Check("Plane 0 private use character U+F123", "\uf123", "", 
Profile.NAME_PREP, true, true),
+         new Check("Plane 15 private use character U+F1234", "\udb84\ude34", 
"", Profile.NAME_PREP, true, true),
+         new Check("Plane 16 private use character U+10F234", "\udbfc\ude34", 
"", Profile.NAME_PREP, true, true),
+         new Check("Non-character code point U+8FFFE", "\ud9ff\udffe", "", 
Profile.NAME_PREP, true, true),
+         new Check("Non-character code point U+10FFFF", "\udbff\udfff", "", 
Profile.NAME_PREP, true, true),
+         new Check("Surrogate code U+DF42", "\ufffd", "", Profile.NAME_PREP, 
true, true),
+         new Check("Non-plain text character U+FFFD", "\ufffd", "", 
Profile.NAME_PREP, true, true),
+         new Check("Ideographic description character U+2FF5", "\u2ff5", "", 
Profile.NAME_PREP, true, true),
+         new Check("Display property character U+0341", "\u0341", "\u0301"),
+         new Check("Left-to-right mark U+200E", "\u200e", "\u0301", 
Profile.NAME_PREP, true, true),
+         new Check("Deprecated U+202A", "\u202a", "\u0301", Profile.NAME_PREP, 
true, true),
+         new Check("Language tagging character U+E0001", "\udb40\udc01", 
"\u0301", Profile.NAME_PREP, true, true),
+         new Check("Language tagging character U+E0042", "\udb40\udc42", "", 
Profile.NAME_PREP, true, true),
+         new Check("Bidi: RandALCat character U+05BE and LCat characters", 
"foo\u05bebar", "", Profile.NAME_PREP, true, true),
+         new Check("Bidi: RandALCat character U+FD50 and LCat characters", 
"foo\ufd50bar", "", Profile.NAME_PREP, true, true),
+         new Check("Bidi: RandALCat character U+FB38 and LCat characters", 
"foo\ufe76bar", "foo \u064ebar"),
+         new Check("Bidi: RandALCat without trailing RandALCat U+0627 U+0031", 
"\u06271", "", Profile.NAME_PREP, true, true),
+         new Check("Bidi: RandALCat character U+0627 U+0031 U+0628", 
"\u06271\u0628", "\u06271\u0628"),
+         new Check("Unassigned code point U+E0002", "\udb40\udc02", "", 
Profile.NAME_PREP, false, true),
+         new Check("Larger test (shrinking)", 
"X\u00ad\u00df\u0130\u2121j\u030c\u00a0\u00aa\u03b0\u2000", 
"xssi\u0307tel\u01f0 a\u03b0 "),
+         new Check("Larger test (expanding)", 
"X\u00df\u3316\u0130\u2121\u249f\u3300", 
"xss\u30ad\u30ed\u30e1\u30fc\u30c8\u30ebi\u0307tel(d)\u30a2\u30d1\u30fc\u30c8"),
+         new Check("Test of prohibited ASCII character U+0020", " ", "", 
Profile.NODE_PREP, true, true),
+         new Check("Test of NFKC U+00A0 and prohibited character U+0020", 
"\u00a0", "", Profile.NODE_PREP, true, true),
+         new Check("Case map + normalization", "\u00b5", "\u03bc"),
+         new Check("NFKC test", "\u00aa", "a"),
+         new Check("nameprep, exposed a bug in libstringprep 0.0.5", 
"\u00aa\n", "a\n"),
+         new Check("unassigned code point U+0221", "\u0221", "\u0221"),
+         new Check("Unassigned code point U+0221", "\u0221", "", 
Profile.NAME_PREP, false, true),
+         new Check("Unassigned code point U+0236", "\u0236", "\u0236"),
+         new Check("unassigned code point U+0236", "\u0236", "", 
Profile.NAME_PREP, false, true),
+         new Check("bidi both RandALCat and LCat  U+0627 U+00AA U+0628", 
"\u0627\u00aa\u0628", "", Profile.NAME_PREP, true, true),
+         new Check("XMPP node profile prohibited output", "address@hidden", 
"", Profile.NODE_PREP, true, true),
+         new Check("XMPP resource profile on same string should work though", 
"address@hidden", "address@hidden", Profile.RESOURCE_PREP, true, false)
+
+  };
+
+  @Test
+  public void testStringprep() {
+    int i = 0;
+    for (final Check check : checks) {
+      try {
+       final String out = check.profile.prep(check.in, check.allowUnassigned);
+       if (check.expectException) {
+         Assert.fail("Unexpectedly got no exception at idx=" + i + ", check: " 
+ check);
+       }
+       Assert.assertEquals("Check output mismatch: " + check, check.out, out);
+      } catch (StringprepException e) {
+       if (!check.expectException) {
+         e.printStackTrace();
+         Assert.fail("Unexpectedly got exception at idx=" + i + ", check: " + 
check);
+       }
+      } catch (RuntimeException ex) {
+       ex.printStackTrace();
+       Assert.fail("Oops, RuntimeException at idx=" + i + " testing " + check);
+      }
+      i++;
+    }
+  }
+}
diff --git 
a/java/src/test/java/gnu/inet/encoding/caliper/CaliperStringprep.java 
b/java/src/test/java/gnu/inet/encoding/caliper/CaliperStringprep.java
new file mode 100644
index 0000000..d317907
--- /dev/null
+++ b/java/src/test/java/gnu/inet/encoding/caliper/CaliperStringprep.java
@@ -0,0 +1,169 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   Author: Stefan Larsson
+
+   This file is part of GNU Libidn.
+
+   GNU Libidn is free software: you can redistribute it and/or
+   modify it under the terms of either:
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version.
+
+   or
+
+     * the GNU General Public License as published by the Free
+       Software Foundation; either version 2 of the License, or (at
+       your option) any later version.
+
+   or both in parallel, as here.
+
+   GNU Libidn is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>. */
+
+package gnu.inet.encoding.caliper;
+
+import com.google.caliper.Runner;
+import com.google.caliper.SimpleBenchmark;
+import com.google.common.collect.ObjectArrays;
+import gnu.inet.encoding.Stringprep;
+import gnu.inet.encoding.StringprepException;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
address@hidden("UnusedDeclaration")
+public class CaliperStringprep extends SimpleBenchmark
+{
+
+  public CaliperStringprep()
+  {
+  }
+
+  public static void main(final String... args) {
+    // Caliper:
+    CaliperStringprep benchmark = new CaliperStringprep();
+    benchmark.runCaliper();
+
+    // Plain run, use with profiling
+    // 100K -> 10s normal run
+    // 1K -> minute(s)? with hprof times
+/*
+    final int reps = 1000;
+    try {
+      benchmark.timeNodePrep3x(reps);
+      benchmark.timeNamePrep3x(reps);
+      benchmark.timeResourcePrep3x(reps);
+      benchmark.timeXMPPStringpreps3x(reps);
+    } catch (StringprepException ex) {
+      throw new IllegalStateException(ex);
+    }
+*/
+  }
+
+  /**
+   * This test case is just a means of allowing to start caliper tests
+   * automatically from a build.
+   *
+   * In order to make nice graphs of performance changes over time,
+   * you can use jenkins/hudson together with caliper-ci, see
+   * Docs: https://code.google.com/p/caliper-ci/
+   * Source: https://github.com/jenkinsci/caliper-ci-plugin
+   *
+   * Create a jenkins project using maven to build this software.
+   * Use these as maven goals: "-P caliper -U clean verify".
+   * Set "POM" (hidden behind Advanced button) to "java/pom.xml"
+   * Add the "Publish Caliper microbenchmark results" post-build action.
+   * In the caliper-ci post-build action, set
+   * "JSON result files" to "java/*.caliper.json".
+   */
+  @Test
+  @Category(CaliperStringprep.class)
+  public void runCaliper() {
+    new Runner().run(ObjectArrays.concat(
+           new String[] {"--saveResults", "CaliperStringprep.caliper.json",
+                         "-JBiasedLocking=-XX:BiasedLockingStartupDelay=0",
+                         "-JServer=-server",
+                         "-JAggressiveOpts=-XX:+AggressiveOpts"},
+           CaliperStringprep.class.getName()));
+  }
+
+  public int timeNodePrep3x(final int reps) throws StringprepException
+  {
+    int dummy = 0;
+    for (int i = 0; i < reps; i++) {
+      final String out = Stringprep.nodeprep("XmPpUserName");
+      final String out2 = Stringprep.nodeprep("xmppusername");
+      final String out3 = 
Stringprep.nodeprep("xmppusername\u1fb7\u200b\u1f56\u00df");
+      dummy += out.length() + out2.length() + out3.length();
+    }
+    return dummy;
+  }
+
+  public int timeNamePrep3x(final int reps) throws StringprepException
+  {
+    int dummy = 0;
+    for (int i = 0; i < reps; i++) {
+      final String out = Stringprep.nameprep("domainName.com");
+      final String out2 = Stringprep.nameprep("domainname.com");
+      final String out3 = Stringprep.nameprep("a" + 
"\u1fb7\u200b\u1f56\u00df.com");
+      dummy += out.length() + out2.length() + out3.length();
+    }
+    return dummy;
+  }
+  public int timeResourcePrep3x(final int reps) throws StringprepException
+  {
+    int dummy = 0;
+    for (int i = 0; i < reps; i++) {
+      final String out = Stringprep.resourceprep("Client-12345");
+      final String out2 = Stringprep.resourceprep("res");
+      final String out3 = 
Stringprep.resourceprep("res\u1fb7\u200b\u1f56\u00df");
+      dummy += out.length() + out2.length() + out3.length();
+    }
+    return dummy;
+  }
+
+  public int timeXMPPStringpreps3x(final int reps) throws StringprepException
+  {
+    int dummy = 0;
+    for (int i = 0; i < reps; i++) {
+      final String outA1 = Stringprep.nodeprep("XmPpUserName");
+      final String outA2 = Stringprep.nameprep("domainName.com");
+      final String outA3 = Stringprep.resourceprep("Client-12345");
+
+      final String outB1 = Stringprep.nodeprep("xmppusername");
+      final String outB2 = Stringprep.nameprep("domainname.com");
+      final String outB3 = Stringprep.resourceprep("res");
+
+      // difficult to optimize away unusual characters deep inside 
lookup-tables
+      final String outC1 = 
Stringprep.nodeprep("xmppusername\u1fb7\u200b\u1f56\u00df");
+      final String outC2 = Stringprep.nameprep("a" + 
"\u1fb7\u200b\u1f56\u00df.com");
+      final String outC3 = 
Stringprep.resourceprep("res\u1fb7\u200b\u1f56\u00df");
+
+      dummy += outA1.length() + outB2.length() + outC3.length();
+    }
+    return dummy;
+  }
+
+  /**
+   * Easy to optimize input but still common for XMPP.
+   */
+  public int timeXMPPSimpleStringprep(final int reps) throws 
StringprepException
+  {
+    int dummy = 0;
+    for (int i = 0; i < reps; i++) {
+      final String out1 = Stringprep.nodeprep("myusername5");
+      final String out2 = Stringprep.nameprep("domainname.com");
+      final String out3 = Stringprep.resourceprep("Resource-1234");
+
+      dummy += out1.length() + out2.length() + out3.length();
+    }
+    return dummy;
+  }
+
+}
diff --git a/java/gnu/Makefile.am b/java/src/util/Makefile.am
similarity index 92%
rename from java/gnu/Makefile.am
rename to java/src/util/Makefile.am
index e40dc86..7873a72 100644
--- a/java/gnu/Makefile.am
+++ b/java/src/util/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012 Simon Josefsson
+# Copyright (C) 2004-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
@@ -16,4 +16,4 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUBDIRS = inet
+SUBDIRS = java
diff --git a/java/misc/GenerateNFKC.java b/java/src/util/java/GenerateNFKC.java
similarity index 97%
rename from java/misc/GenerateNFKC.java
rename to java/src/util/java/GenerateNFKC.java
index efe3899..4e37918 100644
--- a/java/misc/GenerateNFKC.java
+++ b/java/src/util/java/GenerateNFKC.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -51,7 +51,7 @@ public class GenerateNFKC
 
   static String[] split(String in, char sep)
   {
-    StringBuffer sb = new StringBuffer(in);
+    StringBuilder sb = new StringBuilder(in);
     int c = 0;
     for (int i = 0; i < sb.length(); i++) {
       if (sb.charAt(i) == sep) {
@@ -91,7 +91,7 @@ public class GenerateNFKC
 
   static String toJavaString(String in)
   {
-    StringBuffer out = new StringBuffer();
+    StringBuilder out = new StringBuilder();
     String[] chars = split(in, ' ');
     for (int i = 0; i < chars.length; i++) {
       if (chars[i].equals("005C")) {
@@ -108,7 +108,7 @@ public class GenerateNFKC
 
   static String decompose(String in, TreeMap mappings)
   {
-    StringBuffer out = new StringBuffer("");
+    StringBuilder out = new StringBuilder("");
     String[] c = split(in, ' ');
 
     for (int i = 0; i < c.length; i++) {
@@ -344,14 +344,14 @@ public class GenerateNFKC
       w.println("public class CombiningClass");
       w.println("{");
       w.println("  public final static int[][] c = new int[][] {");
-      StringBuffer index = new StringBuffer();
+      StringBuilder index = new StringBuilder();
 
       int count = 0;
       
       for (int i = 0; i < 256; i++) {
        boolean empty = true;
        
-       StringBuffer page = new StringBuffer();
+       StringBuilder page = new StringBuilder();
        page.append("    { /* Page "+i+" */");
        
        for (int j = 0; j < 256; j++) {
@@ -547,13 +547,13 @@ public class GenerateNFKC
       w.println("  public final static int singleFirstStart = 
"+singleFirstStart+";");
       w.println("  public final static int singleSecondStart = 
"+singleSecondStart+";");
 
-      StringBuffer compositionPages = new StringBuffer();
+      StringBuilder compositionPages = new StringBuilder();
 
       w.println("  public final static int[] composePage = new int[] {");
       int pageCount = 0;
       for (int j = 0; j*256 < composeLookupMax+255; j++) {
        boolean empty = true;
-       StringBuffer page = new StringBuffer();
+       StringBuilder page = new StringBuilder();
        for (int k = 0; k < 256; k++) {
          if (k % 16 == 0) {
            page.append("\n      ");
diff --git a/java/misc/GenerateRFC3454.java 
b/java/src/util/java/GenerateRFC3454.java
similarity index 96%
rename from java/misc/GenerateRFC3454.java
rename to java/src/util/java/GenerateRFC3454.java
index 3743c46..b7e364e 100644
--- a/java/misc/GenerateRFC3454.java
+++ b/java/src/util/java/GenerateRFC3454.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -58,7 +58,7 @@ public class GenerateRFC3454
 
     public String next()
     {
-      StringBuffer s = new StringBuffer(Integer.toHexString(f));
+      StringBuilder s = new StringBuilder(Integer.toHexString(f));
       while (s.length() < 4) {
        s.insert(0, '0');
       }
@@ -96,8 +96,8 @@ public class GenerateRFC3454
     int n = 0;
     
     String t = null;
-    StringBuffer o1 = null;
-    StringBuffer o2 = null;
+    StringBuilder o1 = null;
+    StringBuilder o2 = null;
     
     while (true) {
       String l = r.readLine();
@@ -117,8 +117,8 @@ public class GenerateRFC3454
       } else if (-1 != l.indexOf("----- Start Table ")) {
        // Start of a table
        t = l.substring(l.indexOf("Table")+6, l.lastIndexOf("-----")-1);
-       o1 = new StringBuffer();
-       o2 = new StringBuffer();
+       o1 = new StringBuilder();
+       o2 = new StringBuilder();
       } else if (-1 != l.indexOf("----- End Table ")) {
        // End of a table
        if ("A.1".equals(t)) {
diff --git a/java/misc/Makefile.am b/java/src/util/java/Makefile.am
similarity index 80%
rename from java/misc/Makefile.am
rename to java/src/util/java/Makefile.am
index 3ce0c3e..f7f2992 100644
--- a/java/misc/Makefile.am
+++ b/java/src/util/java/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2004-2012  Free Software Foundation
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
 #
 # This file is part of GNU Libidn.
 #
@@ -16,8 +16,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-JAVAROOT = $(top_builddir)/java/misc
-AM_JAVACFLAGS = -classpath 
$(top_builddir)/java/libidn-$(VERSION).jar:$(top_srcdir)/java/libidn-$(VERSION).jar
+JAVAROOT = $(top_builddir)/java/src/util/java
+AM_JAVACFLAGS = -classpath $(top_builddir)/java/src/main/java
 
 if JAVA
 dist_noinst_JAVA = \
diff --git a/java/misc/TestIDNA.java b/java/src/util/java/TestIDNA.java
similarity index 96%
rename from java/misc/TestIDNA.java
rename to java/src/util/java/TestIDNA.java
index 11a3bac..5c01c74 100644
--- a/java/misc/TestIDNA.java
+++ b/java/src/util/java/TestIDNA.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -90,7 +90,7 @@ public class TestIDNA
       BufferedReader r = new BufferedReader(new FileReader(f));
       int state = STATE_SCAN;
 
-      StringBuffer input = new StringBuffer();
+      StringBuilder input = new StringBuilder();
       String out;
 
       while (true) {
@@ -103,7 +103,7 @@ public class TestIDNA
        case STATE_SCAN:
          if (l.startsWith("input (length ")) {
            state = STATE_INPUT;
-           input = new StringBuffer();
+           input = new StringBuilder();
          }
          break;
        case STATE_INPUT:
diff --git a/java/misc/TestNFKC.java b/java/src/util/java/TestNFKC.java
similarity index 95%
rename from java/misc/TestNFKC.java
rename to java/src/util/java/TestNFKC.java
index 3a08c2d..244c54c 100644
--- a/java/misc/TestNFKC.java
+++ b/java/src/util/java/TestNFKC.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
    Author: Oliver Hitz
 
    This file is part of GNU Libidn.
@@ -47,7 +47,7 @@ public class TestNFKC
 
   static String[] split(String in, char sep)
   {
-    StringBuffer sb = new StringBuffer(in);
+    StringBuilder sb = new StringBuilder(in);
     int c = 0;
     for (int i = 0; i < sb.length(); i++) {
       if (sb.charAt(i) == sep) {
@@ -88,7 +88,7 @@ public class TestNFKC
 
   static String evalUnicode(String in)
   {
-    StringBuffer out = new StringBuffer();
+    StringBuilder out = new StringBuilder();
     String[] s = split(in, ' ');
     for (int i = 0; i < s.length; i++) {
       out.append((char) Integer.parseInt(s[i], 16));
@@ -98,7 +98,7 @@ public class TestNFKC
 
   static String toUnicode(String in)
   {
-    StringBuffer out = new StringBuffer();
+    StringBuilder out = new StringBuilder();
     for (int i = 0; i < in.length(); i++) {
       int c = in.charAt(i);
       out.append(Integer.toHexString(c));
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 69d0989..f230f40 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2002-2012 Simon Josefsson.
-# Copyright (C) 2004, 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Simon Josefsson.
+# Copyright (C) 2004, 2010-2013 Free Software Foundation, Inc.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/lib/gen-stringprep-tables.pl b/lib/gen-stringprep-tables.pl
index 9c98b7b..408fae1 100755
--- a/lib/gen-stringprep-tables.pl
+++ b/lib/gen-stringprep-tables.pl
@@ -1,6 +1,6 @@
 #! /usr/bin/perl -w
 
-# Copyright (C) 2002-2012 Simon Josefsson
+# Copyright (C) 2002-2013 Simon Josefsson
 
 # 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/gen-tld-tables.pl b/lib/gen-tld-tables.pl
index 928dff9..1e701d7 100755
--- a/lib/gen-tld-tables.pl
+++ b/lib/gen-tld-tables.pl
@@ -2,8 +2,8 @@
 
 # Author: Thomas Jacob, Internet24.de
 
-# Copyright (C) 2004-2012 Simon Josefsson.
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Simon Josefsson.
+# 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/lib/gen-unicode-tables.pl b/lib/gen-unicode-tables.pl
index d43323c..56bbb73 100755
--- a/lib/gen-unicode-tables.pl
+++ b/lib/gen-unicode-tables.pl
@@ -1,6 +1,6 @@
 #! /usr/bin/perl -w
 
-#    Copyright (C) 2004-2012 Simon Josefsson
+#    Copyright (C) 2004-2013 Simon Josefsson
 #    Copyright (C) 1998, 1999 Tom Tromey
 #    Copyright (C) 2001 Red Hat Software
 
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index f3af3c8..fdcce9a 100644
--- a/lib/gl/Makefile.am
+++ b/lib/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
@@ -23,7 +23,7 @@
 # Generated by gnulib-tool.
 # Reproduce by: gnulib-tool --import --dir=. --local-dir=lib/gl/override 
--lib=libgnu --source-base=lib/gl --m4-base=lib/gl/m4 --doc-base=doc 
--tests-base=lib/gltests --aux-dir=build-aux --with-tests --avoid=iconv-h-tests 
--avoid=string-tests --avoid=wchar-tests --lgpl=2 --no-conditional-dependencies 
--libtool --macro-prefix=lgl --no-vc-files gettext-h lib-msvc-compat 
lib-symbol-versions lib-symbol-visibility stdint striconv strverscmp
 
-AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
+AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects
 
 SUBDIRS =
 noinst_HEADERS =
diff --git a/lib/gl/c-ctype.c b/lib/gl/c-ctype.c
index 2506d02..567c9db 100644
--- a/lib/gl/c-ctype.c
+++ b/lib/gl/c-ctype.c
@@ -1,6 +1,6 @@
 /* Character handling in C locale.
 
-   Copyright 2000-2003, 2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright 2000-2003, 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 Lesser General Public License as published by
diff --git a/lib/gl/c-ctype.h b/lib/gl/c-ctype.h
index cad6797..fa992f6 100644
--- a/lib/gl/c-ctype.h
+++ b/lib/gl/c-ctype.h
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 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 Lesser General Public License as published by
@@ -136,7 +136,8 @@ extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
 extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
 
 
-#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && 
!defined NO_C_CTYPE_MACROS
+#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
+     && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
 
 /* ASCII optimizations. */
 
diff --git a/lib/gl/c-strcase.h b/lib/gl/c-strcase.h
index e1385ce..a38b1dd 100644
--- a/lib/gl/c-strcase.h
+++ b/lib/gl/c-strcase.h
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2012 Free Software
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2013 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/c-strcasecmp.c b/lib/gl/c-strcasecmp.c
index a291207..e7e286c 100644
--- a/lib/gl/c-strcasecmp.c
+++ b/lib/gl/c-strcasecmp.c
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-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 Lesser General Public License as published by
diff --git a/lib/gl/c-strncasecmp.c b/lib/gl/c-strncasecmp.c
index 878d6e0..e2c512e 100644
--- a/lib/gl/c-strncasecmp.c
+++ b/lib/gl/c-strncasecmp.c
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-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 Lesser General Public License as published by
diff --git a/lib/gl/gettext.h b/lib/gl/gettext.h
index 5aa525e..10bdd8a 100644
--- a/lib/gl/gettext.h
+++ b/lib/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/lib/gl/iconv.c b/lib/gl/iconv.c
index 826d990..24abad7 100644
--- a/lib/gl/iconv.c
+++ b/lib/gl/iconv.c
@@ -1,5 +1,5 @@
 /* Character set conversion.
-   Copyright (C) 1999-2001, 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1999-2001, 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 Lesser General Public License as published by
diff --git a/lib/gl/iconv.in.h b/lib/gl/iconv.in.h
index de78cbc..26c6c99 100644
--- a/lib/gl/iconv.in.h
+++ b/lib/gl/iconv.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <iconv.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 Lesser General Public License as published by
diff --git a/lib/gl/iconv_close.c b/lib/gl/iconv_close.c
index 0bccd97..113069d 100644
--- a/lib/gl/iconv_close.c
+++ b/lib/gl/iconv_close.c
@@ -1,5 +1,5 @@
 /* Character set conversion.
-   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 Lesser General Public License as published by
diff --git a/lib/gl/iconv_open.c b/lib/gl/iconv_open.c
index 740bc8d..ff4f6c4 100644
--- a/lib/gl/iconv_open.c
+++ b/lib/gl/iconv_open.c
@@ -1,5 +1,5 @@
 /* Character set conversion.
-   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 Lesser General Public License as published by
diff --git a/lib/gl/m4/00gnulib.m4 b/lib/gl/m4/00gnulib.m4
index d978cb8..d4ad759 100644
--- a/lib/gl/m4/00gnulib.m4
+++ b/lib/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/lib/gl/m4/alloca.m4 b/lib/gl/m4/alloca.m4
index 656924b..270abd0 100644
--- a/lib/gl/m4/alloca.m4
+++ b/lib/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
 # alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2012 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/codeset.m4 b/lib/gl/m4/codeset.m4
index cf53d24..c2761be 100644
--- a/lib/gl/m4/codeset.m4
+++ b/lib/gl/m4/codeset.m4
@@ -1,5 +1,5 @@
 # codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-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/lib/gl/m4/eealloc.m4 b/lib/gl/m4/eealloc.m4
index 9e5df45..c640ec1 100644
--- a/lib/gl/m4/eealloc.m4
+++ b/lib/gl/m4/eealloc.m4
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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/lib/gl/m4/environ.m4 b/lib/gl/m4/environ.m4
index 8eb57c9..593a33e 100644
--- a/lib/gl/m4/environ.m4
+++ b/lib/gl/m4/environ.m4
@@ -1,5 +1,5 @@
 # environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-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/lib/gl/m4/extensions.m4 b/lib/gl/m4/extensions.m4
index 6d17d8a..e30f122 100644
--- a/lib/gl/m4/extensions.m4
+++ b/lib/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
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
 # 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/gl/m4/extern-inline.m4 b/lib/gl/m4/extern-inline.m4
index 0a9fc9a..94b46dd 100644
--- a/lib/gl/m4/extern-inline.m4
+++ b/lib/gl/m4/extern-inline.m4
@@ -1,6 +1,6 @@
 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.
@@ -18,13 +18,24 @@ AC_DEFUN([gl_EXTERN_INLINE],
    _GL_INLINE_HEADER_END contains useful stuff to put
      in the same include file, after uses of _GL_INLINE.
 
-   Suppress the use of extern inline on Apple's platforms,
-   as Libc-825.25 (2012-09-19) is incompatible with it; see
+   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 extern inline with Sun C in standards-conformance mode, as it
+   mishandles inline functions that call each other.  E.g., for 'inline void f
+   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+   'reference to static identifier "f" in extern inline function'.
+   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+   Suppress the use of extern inline on Apple's platforms, as Libc at least
+   through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
    <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__) \
+      : (199901L <= __STDC_VERSION__ \
+         && !defined __HP_cc \
+         && !(defined __SUNPRO_C && __STDC__))) \
      && !defined __APPLE__)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 597d770..e2da31c 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/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/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index 15d2b2b..0ae5a9e 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/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/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index ab66a71..69d1f63 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/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
@@ -237,6 +237,7 @@ changequote([, ])dnl
   gl_LOCALENAME
   AC_CHECK_FUNCS_ONCE([newlocale])
   gl_LOCK
+  gl_MODULE_INDICATOR([lock])
   gl_FUNC_MALLOC_POSIX
   if test $REPLACE_MALLOC = 1; then
     AC_LIBOBJ([malloc])
@@ -246,6 +247,7 @@ changequote([, ])dnl
   gl_FUNC_PUTENV
   if test $REPLACE_PUTENV = 1; then
     AC_LIBOBJ([putenv])
+    gl_PREREQ_PUTENV
   fi
   gl_STDLIB_MODULE_INDICATOR([putenv])
   gl_FUNC_SETENV
@@ -264,8 +266,8 @@ changequote([, ])dnl
   gt_LOCALE_JA
   gt_LOCALE_ZH_CN
   gt_TYPE_SSIZE_T
-  gt_TYPE_WCHAR_T
-  gt_TYPE_WINT_T
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
   gl_STDLIB_H
   gl_SYS_TYPES_H
   AC_PROG_MKDIR_P
diff --git a/lib/gl/m4/gnulib-tool.m4 b/lib/gl/m4/gnulib-tool.m4
index a09ffc1..f3dea1a 100644
--- a/lib/gl/m4/gnulib-tool.m4
+++ b/lib/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/lib/gl/m4/iconv.m4 b/lib/gl/m4/iconv.m4
index 6a47236..a503646 100644
--- a/lib/gl/m4/iconv.m4
+++ b/lib/gl/m4/iconv.m4
@@ -1,5 +1,5 @@
 # iconv.m4 serial 18 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 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/lib/gl/m4/iconv_h.m4 b/lib/gl/m4/iconv_h.m4
index aa86cf8..f0519d9 100644
--- a/lib/gl/m4/iconv_h.m4
+++ b/lib/gl/m4/iconv_h.m4
@@ -1,5 +1,5 @@
 # iconv_h.m4 serial 8
-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/lib/gl/m4/iconv_open.m4 b/lib/gl/m4/iconv_open.m4
index 07f4849..1dcf414 100644
--- a/lib/gl/m4/iconv_open.m4
+++ b/lib/gl/m4/iconv_open.m4
@@ -1,5 +1,5 @@
 # iconv_open.m4 serial 14
-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/lib/gl/m4/include_next.m4 b/lib/gl/m4/include_next.m4
index a60a261..108d945 100644
--- a/lib/gl/m4/include_next.m4
+++ b/lib/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/lib/gl/m4/inline.m4 b/lib/gl/m4/inline.m4
index 6fa9972..3a50621 100644
--- a/lib/gl/m4/inline.m4
+++ b/lib/gl/m4/inline.m4
@@ -1,5 +1,5 @@
 # inline.m4 serial 4
-dnl Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 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/lib/gl/m4/intlmacosx.m4 b/lib/gl/m4/intlmacosx.m4
index d4da190..ab97d39 100644
--- a/lib/gl/m4/intlmacosx.m4
+++ b/lib/gl/m4/intlmacosx.m4
@@ -1,5 +1,5 @@
 # intlmacosx.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2004-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-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/lib/gl/m4/inttypes-pri.m4 b/lib/gl/m4/inttypes-pri.m4
index 977206f..e5a1e05 100644
--- a/lib/gl/m4/inttypes-pri.m4
+++ b/lib/gl/m4/inttypes-pri.m4
@@ -1,5 +1,5 @@
 # inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-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/lib/gl/m4/inttypes.m4 b/lib/gl/m4/inttypes.m4
index eec4f41..3b483d3 100644
--- a/lib/gl/m4/inttypes.m4
+++ b/lib/gl/m4/inttypes.m4
@@ -1,5 +1,5 @@
 # inttypes.m4 serial 26
-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/lib/gl/m4/lcmessage.m4 b/lib/gl/m4/lcmessage.m4
index 4ed0eb6..d62a175 100644
--- a/lib/gl/m4/lcmessage.m4
+++ b/lib/gl/m4/lcmessage.m4
@@ -1,5 +1,5 @@
 # lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2012 Free Software Foundation,
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/ld-output-def.m4 b/lib/gl/m4/ld-output-def.m4
index 3511684..59895bc 100644
--- a/lib/gl/m4/ld-output-def.m4
+++ b/lib/gl/m4/ld-output-def.m4
@@ -1,5 +1,5 @@
 # ld-output-def.m4 serial 2
-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/lib/gl/m4/ld-version-script.m4 b/lib/gl/m4/ld-version-script.m4
index 5ed93ef..63386f1 100644
--- a/lib/gl/m4/ld-version-script.m4
+++ b/lib/gl/m4/ld-version-script.m4
@@ -1,5 +1,5 @@
 # ld-version-script.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/lib/gl/m4/lib-ld.m4 b/lib/gl/m4/lib-ld.m4
index e1feab5..c145e47 100644
--- a/lib/gl/m4/lib-ld.m4
+++ b/lib/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
 # lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 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/lib/gl/m4/lib-link.m4 b/lib/gl/m4/lib-link.m4
index d11b4b4..073f040 100644
--- a/lib/gl/m4/lib-link.m4
+++ b/lib/gl/m4/lib-link.m4
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 26 (gettext-0.18.2)
-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/lib/gl/m4/lib-prefix.m4 b/lib/gl/m4/lib-prefix.m4
index 007aa05..60908e8 100644
--- a/lib/gl/m4/lib-prefix.m4
+++ b/lib/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 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/lib/gl/m4/libunistring-base.m4 b/lib/gl/m4/libunistring-base.m4
index d91c42b..d105c72 100644
--- a/lib/gl/m4/libunistring-base.m4
+++ b/lib/gl/m4/libunistring-base.m4
@@ -1,5 +1,5 @@
 # libunistring-base.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/lib/gl/m4/locale-fr.m4 b/lib/gl/m4/locale-fr.m4
index 71b6847..ef199e3 100644
--- a/lib/gl/m4/locale-fr.m4
+++ b/lib/gl/m4/locale-fr.m4
@@ -1,5 +1,5 @@
 # locale-fr.m4 serial 17
-dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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.
diff --git a/lib/gl/m4/locale-ja.m4 b/lib/gl/m4/locale-ja.m4
index 5ba0e43..132a3e7 100644
--- a/lib/gl/m4/locale-ja.m4
+++ b/lib/gl/m4/locale-ja.m4
@@ -1,5 +1,5 @@
 # locale-ja.m4 serial 12
-dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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.
diff --git a/lib/gl/m4/locale-tr.m4 b/lib/gl/m4/locale-tr.m4
index 5f3bf80..aeb5615 100644
--- a/lib/gl/m4/locale-tr.m4
+++ b/lib/gl/m4/locale-tr.m4
@@ -1,5 +1,5 @@
 # locale-tr.m4 serial 10
-dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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.
diff --git a/lib/gl/m4/locale-zh.m4 b/lib/gl/m4/locale-zh.m4
index e5502b2..4eed73f 100644
--- a/lib/gl/m4/locale-zh.m4
+++ b/lib/gl/m4/locale-zh.m4
@@ -1,5 +1,5 @@
 # locale-zh.m4 serial 12
-dnl Copyright (C) 2003, 2005-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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.
diff --git a/lib/gl/m4/locale_h.m4 b/lib/gl/m4/locale_h.m4
index c0f4d52..8bd12e8 100644
--- a/lib/gl/m4/locale_h.m4
+++ b/lib/gl/m4/locale_h.m4
@@ -1,5 +1,5 @@
 # locale_h.m4 serial 19
-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/lib/gl/m4/localename.m4 b/lib/gl/m4/localename.m4
index 2ba295e..361ed73 100644
--- a/lib/gl/m4/localename.m4
+++ b/lib/gl/m4/localename.m4
@@ -1,5 +1,5 @@
 # localename.m4 serial 2
-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/lib/gl/m4/lock.m4 b/lib/gl/m4/lock.m4
index 83da6cc..aae1701 100644
--- a/lib/gl/m4/lock.m4
+++ b/lib/gl/m4/lock.m4
@@ -1,5 +1,5 @@
 # lock.m4 serial 13 (gettext-0.18.2)
-dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
+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.
@@ -24,6 +24,9 @@ AC_DEFUN([gl_LOCK],
         [[
 #if __FreeBSD__ == 4
 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+       && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
 #else
 int x = (int)PTHREAD_MUTEX_RECURSIVE;
 return !x;
diff --git a/lib/gl/m4/longlong.m4 b/lib/gl/m4/longlong.m4
index b9c65c7..3af6ab5 100644
--- a/lib/gl/m4/longlong.m4
+++ b/lib/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/lib/gl/m4/malloc.m4 b/lib/gl/m4/malloc.m4
index 8fa48e9..4b24a0b 100644
--- a/lib/gl/m4/malloc.m4
+++ b/lib/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/lib/gl/m4/malloca.m4 b/lib/gl/m4/malloca.m4
index 7841979..791ce10 100644
--- a/lib/gl/m4/malloca.m4
+++ b/lib/gl/m4/malloca.m4
@@ -1,5 +1,5 @@
 # malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2012 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lib/gl/m4/multiarch.m4 b/lib/gl/m4/multiarch.m4
index 0c288b8..552ec7e 100644
--- a/lib/gl/m4/multiarch.m4
+++ b/lib/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/lib/gl/m4/off_t.m4 b/lib/gl/m4/off_t.m4
index dfca2df..d355d01 100644
--- a/lib/gl/m4/off_t.m4
+++ b/lib/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/lib/gl/m4/putenv.m4 b/lib/gl/m4/putenv.m4
index b971b12..c33b5b5 100644
--- a/lib/gl/m4/putenv.m4
+++ b/lib/gl/m4/putenv.m4
@@ -1,5 +1,5 @@
-# putenv.m4 serial 19
-dnl Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# putenv.m4 serial 20
+dnl Copyright (C) 2002-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.
@@ -48,3 +48,9 @@ AC_DEFUN([gl_FUNC_PUTENV],
       ;;
   esac
 ])
+
+# Prerequisites of lib/putenv.c.
+AC_DEFUN([gl_PREREQ_PUTENV],
+[
+  AC_CHECK_DECLS([_putenv])
+])
diff --git a/lib/gl/m4/setenv.m4 b/lib/gl/m4/setenv.m4
index e1931e7..cb5351a 100644
--- a/lib/gl/m4/setenv.m4
+++ b/lib/gl/m4/setenv.m4
@@ -1,5 +1,5 @@
 # setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-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/lib/gl/m4/setlocale.m4 b/lib/gl/m4/setlocale.m4
index c605241..1133e65 100644
--- a/lib/gl/m4/setlocale.m4
+++ b/lib/gl/m4/setlocale.m4
@@ -1,5 +1,5 @@
 # setlocale.m4 serial 4
-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/lib/gl/m4/ssize_t.m4 b/lib/gl/m4/ssize_t.m4
index 209d64c..6338134 100644
--- a/lib/gl/m4/ssize_t.m4
+++ b/lib/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/lib/gl/m4/stdbool.m4 b/lib/gl/m4/stdbool.m4
index eabfa64..80d5559 100644
--- a/lib/gl/m4/stdbool.m4
+++ b/lib/gl/m4/stdbool.m4
@@ -1,6 +1,6 @@
 # Check for stdbool.h that conforms to C99.
 
-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/lib/gl/m4/stddef_h.m4 b/lib/gl/m4/stddef_h.m4
index cc11609..5da8ab1 100644
--- a/lib/gl/m4/stddef_h.m4
+++ b/lib/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/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4
index 28d342e..27cdcdb 100644
--- a/lib/gl/m4/stdint.m4
+++ b/lib/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/lib/gl/m4/stdlib_h.m4 b/lib/gl/m4/stdlib_h.m4
index 9c69f2e..2027ab3 100644
--- a/lib/gl/m4/stdlib_h.m4
+++ b/lib/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])
diff --git a/lib/gl/m4/string_h.m4 b/lib/gl/m4/string_h.m4
index 5677e09..cc5fbbb 100644
--- a/lib/gl/m4/string_h.m4
+++ b/lib/gl/m4/string_h.m4
@@ -1,6 +1,6 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2012 Free Software Foundation, Inc.
+# Copyright (C) 2007-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/lib/gl/m4/strverscmp.m4 b/lib/gl/m4/strverscmp.m4
index d744647..110daf2 100644
--- a/lib/gl/m4/strverscmp.m4
+++ b/lib/gl/m4/strverscmp.m4
@@ -1,5 +1,5 @@
 # strverscmp.m4 serial 8
-dnl Copyright (C) 2002, 2005-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 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.
diff --git a/lib/gl/m4/sys_types_h.m4 b/lib/gl/m4/sys_types_h.m4
index f11eef2..d15c1b3 100644
--- a/lib/gl/m4/sys_types_h.m4
+++ b/lib/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/lib/gl/m4/thread.m4 b/lib/gl/m4/thread.m4
index 3c94d11..86da5c5 100644
--- a/lib/gl/m4/thread.m4
+++ b/lib/gl/m4/thread.m4
@@ -1,5 +1,5 @@
 # thread.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/lib/gl/m4/threadlib.m4 b/lib/gl/m4/threadlib.m4
index cb93391..26bdeb5 100644
--- a/lib/gl/m4/threadlib.m4
+++ b/lib/gl/m4/threadlib.m4
@@ -1,5 +1,5 @@
 # threadlib.m4 serial 10 (gettext-0.18.2)
-dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
+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.
diff --git a/lib/gl/m4/unistd_h.m4 b/lib/gl/m4/unistd_h.m4
index f68fbff..32dcfa5 100644
--- a/lib/gl/m4/unistd_h.m4
+++ b/lib/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
 # unistd_h.m4 serial 66
-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/lib/gl/m4/visibility.m4 b/lib/gl/m4/visibility.m4
index a7d4d8c..6cbd7e5 100644
--- a/lib/gl/m4/visibility.m4
+++ b/lib/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
 # visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 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/lib/gl/m4/warn-on-use.m4 b/lib/gl/m4/warn-on-use.m4
index a77802e..e43beeb 100644
--- a/lib/gl/m4/warn-on-use.m4
+++ b/lib/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/lib/gl/m4/wchar_h.m4 b/lib/gl/m4/wchar_h.m4
index c7a8b2d..bedb15a 100644
--- a/lib/gl/m4/wchar_h.m4
+++ b/lib/gl/m4/wchar_h.m4
@@ -1,6 +1,6 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-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/lib/gl/m4/wchar_t.m4 b/lib/gl/m4/wchar_t.m4
index 534735d..e1e1e69 100644
--- a/lib/gl/m4/wchar_t.m4
+++ b/lib/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/lib/gl/m4/wint_t.m4 b/lib/gl/m4/wint_t.m4
index 3260cce..d7cd3db 100644
--- a/lib/gl/m4/wint_t.m4
+++ b/lib/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
 # wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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/lib/gl/m4/yield.m4 b/lib/gl/m4/yield.m4
index 94e69c4..8197766 100644
--- a/lib/gl/m4/yield.m4
+++ b/lib/gl/m4/yield.m4
@@ -1,5 +1,5 @@
 # yield.m4 serial 2
-dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
+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.
diff --git a/lib/gl/stdbool.in.h b/lib/gl/stdbool.in.h
index 183efe2..d0e4cff 100644
--- a/lib/gl/stdbool.in.h
+++ b/lib/gl/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-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/lib/gl/stddef.in.h b/lib/gl/stddef.in.h
index 9384cf6..51a308a 100644
--- a/lib/gl/stddef.in.h
+++ b/lib/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 Lesser General Public License as published by
diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h
index ff478a6..2430d52 100644
--- a/lib/gl/stdint.in.h
+++ b/lib/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.
 
@@ -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/gl/striconv.c b/lib/gl/striconv.c
index 6083fb7..bc8987b 100644
--- a/lib/gl/striconv.c
+++ b/lib/gl/striconv.c
@@ -1,5 +1,5 @@
 /* Charset conversion.
-   Copyright (C) 2001-2007, 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2010-2013 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/striconv.h b/lib/gl/striconv.h
index 8f09eef..be02fd3 100644
--- a/lib/gl/striconv.h
+++ b/lib/gl/striconv.h
@@ -1,5 +1,5 @@
 /* Charset conversion.
-   Copyright (C) 2001-2004, 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/gl/string.in.h b/lib/gl/string.in.h
index ed187c9..ef25d3c 100644
--- a/lib/gl/string.in.h
+++ b/lib/gl/string.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2012 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 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 Lesser General Public License as published by
diff --git a/lib/gl/strverscmp.c b/lib/gl/strverscmp.c
index 46f3ebc..2091567 100644
--- a/lib/gl/strverscmp.c
+++ b/lib/gl/strverscmp.c
@@ -1,5 +1,5 @@
 /* Compare strings while treating digits characters numerically.
-   Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2012 Free Software
+   Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2013 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jean-François Bignolles <address@hidden>, 1997.
diff --git a/lib/gl/unistr.in.h b/lib/gl/unistr.in.h
index 1ee5085..2bbab42 100644
--- a/lib/gl/unistr.in.h
+++ b/lib/gl/unistr.in.h
@@ -1,5 +1,5 @@
 /* Elementary Unicode string functions.
-   Copyright (C) 2001-2002, 2005-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 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 Lesser General Public License as published
diff --git a/lib/gl/unistr/u8-mbtoucr.c b/lib/gl/unistr/u8-mbtoucr.c
index 6ba4d17..76156e8 100644
--- a/lib/gl/unistr/u8-mbtoucr.c
+++ b/lib/gl/unistr/u8-mbtoucr.c
@@ -1,5 +1,5 @@
 /* Look at first character in UTF-8 string, returning an error code.
-   Copyright (C) 1999-2002, 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2006-2007, 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 it
diff --git a/lib/gl/unistr/u8-uctomb-aux.c b/lib/gl/unistr/u8-uctomb-aux.c
index c157c72..fe6bff3 100644
--- a/lib/gl/unistr/u8-uctomb-aux.c
+++ b/lib/gl/unistr/u8-uctomb-aux.c
@@ -1,5 +1,5 @@
 /* Conversion UCS-4 to UTF-8.
-   Copyright (C) 2002, 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
diff --git a/lib/gl/unistr/u8-uctomb.c b/lib/gl/unistr/u8-uctomb.c
index a7ffd15..c7acc25 100644
--- a/lib/gl/unistr/u8-uctomb.c
+++ b/lib/gl/unistr/u8-uctomb.c
@@ -1,5 +1,5 @@
 /* Store a character in UTF-8 string.
-   Copyright (C) 2002, 2005-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005-2006, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
diff --git a/lib/gl/unitypes.in.h b/lib/gl/unitypes.in.h
index 54eaa4e..27c22f7 100644
--- a/lib/gl/unitypes.in.h
+++ b/lib/gl/unitypes.in.h
@@ -1,5 +1,5 @@
 /* Elementary types and macros for the GNU UniString library.
-   Copyright (C) 2002, 2005-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005-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 Lesser General Public License as published
diff --git a/lib/gltests/Makefile.am b/lib/gltests/Makefile.am
index 58a5b92..927d8d8 100644
--- a/lib/gltests/Makefile.am
+++ b/lib/gltests/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
@@ -22,7 +22,7 @@
 #
 # Generated by gnulib-tool.
 
-AUTOMAKE_OPTIONS = 1.5 foreign subdir-objects
+AUTOMAKE_OPTIONS = 1.9.6 foreign subdir-objects
 
 SUBDIRS = .
 TESTS =
@@ -512,6 +512,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' \
@@ -540,6 +541,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' \
diff --git a/lib/gltests/alloca.in.h b/lib/gltests/alloca.in.h
index d20f4b8..72d28ee 100644
--- a/lib/gltests/alloca.in.h
+++ b/lib/gltests/alloca.in.h
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2013 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
diff --git a/lib/gltests/glthread/lock.c b/lib/gltests/glthread/lock.c
index bc0df29..f62aa30 100644
--- a/lib/gltests/glthread/lock.c
+++ b/lib/gltests/glthread/lock.c
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   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
diff --git a/lib/gltests/glthread/lock.h b/lib/gltests/glthread/lock.h
index 6782d49..d20bbde 100644
--- a/lib/gltests/glthread/lock.h
+++ b/lib/gltests/glthread/lock.h
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   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
diff --git a/lib/gltests/glthread/thread.c b/lib/gltests/glthread/thread.c
index e799d60..fdec869 100644
--- a/lib/gltests/glthread/thread.c
+++ b/lib/gltests/glthread/thread.c
@@ -1,5 +1,5 @@
 /* Creating and controlling threads.
-   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
diff --git a/lib/gltests/glthread/thread.h b/lib/gltests/glthread/thread.h
index 9b500f3..1e9d0f7 100644
--- a/lib/gltests/glthread/thread.h
+++ b/lib/gltests/glthread/thread.h
@@ -1,5 +1,5 @@
 /* Creating and controlling threads.
-   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
@@ -120,7 +120,13 @@ extern int glthread_in_use (void);
    address of a function in libpthread that we don't use.  */
 
 #  pragma weak pthread_create
+
+#  ifdef __clang__
+  /* Without this, clang complains that pthread_sigmask is never declared.  */
+#   include <signal.h>
+#  endif
 #  pragma weak pthread_sigmask
+
 #  pragma weak pthread_join
 #  ifndef pthread_self
 #   pragma weak pthread_self
diff --git a/lib/gltests/glthread/threadlib.c b/lib/gltests/glthread/threadlib.c
index 946268e..b447657 100644
--- a/lib/gltests/glthread/threadlib.c
+++ b/lib/gltests/glthread/threadlib.c
@@ -1,5 +1,5 @@
 /* Multithreading primitives.
-   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
diff --git a/lib/gltests/glthread/yield.h b/lib/gltests/glthread/yield.h
index 63c45be..12cb03b 100644
--- a/lib/gltests/glthread/yield.h
+++ b/lib/gltests/glthread/yield.h
@@ -1,5 +1,5 @@
 /* Yielding the processor to other threads and processes.
-   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
diff --git a/lib/gltests/init.sh b/lib/gltests/init.sh
index 5f6e638..bd2048e 100644
--- a/lib/gltests/init.sh
+++ b/lib/gltests/init.sh
@@ -1,6 +1,6 @@
 # source this file; set up for tests
 
-# 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/lib/gltests/intprops.h b/lib/gltests/intprops.h
index 2485c78..f57f9b4 100644
--- a/lib/gltests/intprops.h
+++ b/lib/gltests/intprops.h
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-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
@@ -89,7 +89,7 @@
 
 /* Return 1 if the __typeof__ keyword works.  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C
+#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
 # define _GL_HAVE___TYPEOF__ 1
 #else
 # define _GL_HAVE___TYPEOF__ 0
diff --git a/lib/gltests/inttypes.in.h b/lib/gltests/inttypes.in.h
index b9da2b5..1893f55 100644
--- a/lib/gltests/inttypes.in.h
+++ b/lib/gltests/inttypes.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2013 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Derek Price.
    This file is part of gnulib.
 
diff --git a/lib/gltests/locale.in.h b/lib/gltests/locale.in.h
index 4d3c543..264161a 100644
--- a/lib/gltests/locale.in.h
+++ b/lib/gltests/locale.in.h
@@ -1,5 +1,5 @@
 /* A POSIX <locale.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
@@ -14,16 +14,30 @@
    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@_LOCALE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
+#ifdef _GL_ALREADY_INCLUDING_LOCALE_H
+
+/* Special invocation conventions to handle Solaris header files
+   (through Solaris 10) when combined with gettext's libintl.h.  */
+
address@hidden@ @NEXT_LOCALE_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef address@hidden@_LOCALE_H
+
+#define _GL_ALREADY_INCLUDING_LOCALE_H
+
 /* The include_next requires a split double-inclusion guard.  */
 address@hidden@ @NEXT_LOCALE_H@
 
+#undef _GL_ALREADY_INCLUDING_LOCALE_H
+
 #ifndef address@hidden@_LOCALE_H
 #define address@hidden@_LOCALE_H
 
@@ -198,4 +212,5 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some 
glibc systems - "
 #endif
 
 #endif /* address@hidden@_LOCALE_H */
+#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
 #endif /* address@hidden@_LOCALE_H */
diff --git a/lib/gltests/localename.c b/lib/gltests/localename.c
index 4803eaf..47cb7ca 100644
--- a/lib/gltests/localename.c
+++ b/lib/gltests/localename.c
@@ -1,5 +1,5 @@
 /* Determine name of the currently selected locale.
-   Copyright (C) 1995-2012 Free Software Foundation, Inc.
+   Copyright (C) 1995-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/gltests/localename.h b/lib/gltests/localename.h
index 330932d..e70eee6 100644
--- a/lib/gltests/localename.h
+++ b/lib/gltests/localename.h
@@ -1,5 +1,5 @@
 /* Determine name of the currently selected locale.
-   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/lib/gltests/macros.h b/lib/gltests/macros.h
index 478004c..60ba894 100644
--- a/lib/gltests/macros.h
+++ b/lib/gltests/macros.h
@@ -1,5 +1,5 @@
 /* Common macros used by gnulib tests.
-   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/lib/gltests/malloc.c b/lib/gltests/malloc.c
index e0d5c89..908735d 100644
--- a/lib/gltests/malloc.c
+++ b/lib/gltests/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/lib/gltests/malloca.c b/lib/gltests/malloca.c
index 1f7533a..311be56 100644
--- a/lib/gltests/malloca.c
+++ b/lib/gltests/malloca.c
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -49,12 +49,18 @@
 #define MAGIC_SIZE sizeof (int)
 /* This is how the header info would look like without any alignment
    considerations.  */
-struct preliminary_header { void *next; char room[MAGIC_SIZE]; };
+struct preliminary_header { void *next; int magic; };
 /* But the header's size must be a multiple of sa_alignment_max.  */
 #define HEADER_SIZE \
   (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / 
sa_alignment_max) * sa_alignment_max)
-struct header { void *next; char room[HEADER_SIZE - sizeof (struct 
preliminary_header) + MAGIC_SIZE]; };
-verify (HEADER_SIZE == sizeof (struct header));
+union header {
+  void *next;
+  struct {
+    char room[HEADER_SIZE - MAGIC_SIZE];
+    int word;
+  } magic;
+};
+verify (HEADER_SIZE == sizeof (union header));
 /* We make the hash table quite big, so that during lookups the probability
    of empty hash buckets is quite high.  There is no need to make the hash
    table resizable, because when the hash table gets filled so much that the
@@ -74,20 +80,21 @@ mmalloca (size_t n)
 
   if (nplus >= n)
     {
-      char *p = (char *) malloc (nplus);
+      void *p = malloc (nplus);
 
       if (p != NULL)
         {
           size_t slot;
+          union header *h = p;
 
-          p += HEADER_SIZE;
+          p = h + 1;
 
           /* Put a magic number into the indicator word.  */
-          ((int *) p)[-1] = MAGIC_NUMBER;
+          h->magic.word = MAGIC_NUMBER;
 
           /* Enter p into the hash table.  */
           slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot];
+          h->next = mmalloca_results[slot];
           mmalloca_results[slot] = p;
 
           return p;
@@ -123,15 +130,17 @@ freea (void *p)
           void **chain = &mmalloca_results[slot];
           for (; *chain != NULL;)
             {
+              union header *h = p;
               if (*chain == p)
                 {
                   /* Found it.  Remove it from the hash table and free it.  */
-                  char *p_begin = (char *) p - HEADER_SIZE;
-                  *chain = ((struct header *) p_begin)->next;
+                  union header *p_begin = h - 1;
+                  *chain = p_begin->next;
                   free (p_begin);
                   return;
                 }
-              chain = &((struct header *) ((char *) *chain - 
HEADER_SIZE))->next;
+              h = *chain;
+              chain = &h[-1].next;
             }
         }
       /* At this point, we know it was not a mmalloca() result.  */
diff --git a/lib/gltests/malloca.h b/lib/gltests/malloca.h
index f06e9e7..6fbe45e 100644
--- a/lib/gltests/malloca.h
+++ b/lib/gltests/malloca.h
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2013 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -92,7 +92,7 @@ extern void * nmalloca (size_t n, size_t s);
 /* ------------------- Auxiliary, non-public definitions ------------------- */
 
 /* Determine the alignment of a type at compile time.  */
-#if defined __GNUC__
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
 # define sa_alignof __alignof__
 #elif defined __cplusplus
   template <class type> struct sa_alignof_helper { char __slot1; type __slot2; 
};
diff --git a/lib/gltests/putenv.c b/lib/gltests/putenv.c
index 3c0f7ea..5461273 100644
--- a/lib/gltests/putenv.c
+++ b/lib/gltests/putenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2012 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2013 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
@@ -34,6 +34,11 @@
 #include <string.h>
 #include <unistd.h>
 
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 #if _LIBC
 # if HAVE_GNU_LD
 #  define environ __environ
@@ -57,7 +62,9 @@ static int
 _unsetenv (const char *name)
 {
   size_t len;
+#if !HAVE_DECL__PUTENV
   char **ep;
+#endif
 
   if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
     {
@@ -67,6 +74,21 @@ _unsetenv (const char *name)
 
   len = strlen (name);
 
+#if HAVE_DECL__PUTENV
+  {
+    int putenv_result, putenv_errno;
+    char *name_ = malloc (len + 2);
+    memcpy (name_, name, len);
+    name_[len] = '=';
+    name_[len + 1] = 0;
+    putenv_result = _putenv (name_);
+    putenv_errno = errno;
+    free (name_);
+    __set_errno (putenv_errno);
+    return putenv_result;
+  }
+#else
+
   LOCK;
 
   ep = environ;
@@ -87,6 +109,7 @@ _unsetenv (const char *name)
   UNLOCK;
 
   return 0;
+#endif
 }
 
 
@@ -95,9 +118,8 @@ _unsetenv (const char *name)
 int
 putenv (char *string)
 {
-  const char *const name_end = strchr (string, '=');
-  register size_t size;
-  register char **ep;
+  const char *name_end = strchr (string, '=');
+  char **ep;
 
   if (name_end == NULL)
     {
@@ -105,30 +127,68 @@ putenv (char *string)
       return _unsetenv (string);
     }
 
-  size = 0;
-  for (ep = environ; *ep != NULL; ++ep)
-    if (!strncmp (*ep, string, name_end - string) &&
-        (*ep)[name_end - string] == '=')
+#if HAVE_DECL__PUTENV
+  /* Rely on _putenv to allocate the new environment.  If other
+     parts of the application use _putenv, the !HAVE_DECL__PUTENV code
+     would fight over who owns the environ vector, causing a crash.  */
+  if (name_end[1])
+    return _putenv (string);
+  else
+    {
+      /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
+         to allocate the environ vector and then replace the new
+         entry with "NAME=".  */
+      int putenv_result, putenv_errno;
+      char *name_x = malloc (name_end - string + sizeof "= ");
+      if (!name_x)
+        return -1;
+      memcpy (name_x, string, name_end - string + 1);
+      name_x[name_end - string + 1] = ' ';
+      name_x[name_end - string + 2] = 0;
+      putenv_result = _putenv (name_x);
+      putenv_errno = errno;
+      for (ep = environ; *ep; ep++)
+        if (strcmp (*ep, name_x) == 0)
+          {
+            *ep = string;
+            break;
+          }
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+      if (putenv_result == 0)
+        {
+          /* _putenv propagated "NAME= " into the subprocess environment;
+             fix that by calling SetEnvironmentVariable directly.  */
+          name_x[name_end - string] = 0;
+          putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
+          putenv_errno = ENOMEM; /* ENOMEM is the only way to fail.  */
+        }
+# endif
+      free (name_x);
+      __set_errno (putenv_errno);
+      return putenv_result;
+    }
+#else
+  for (ep = environ; *ep; ep++)
+    if (strncmp (*ep, string, name_end - string) == 0
+        && (*ep)[name_end - string] == '=')
       break;
-    else
-      ++size;
 
-  if (*ep == NULL)
+  if (*ep)
+    *ep = string;
+  else
     {
       static char **last_environ = NULL;
-      char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
-      if (new_environ == NULL)
+      size_t size = ep - environ;
+      char **new_environ = malloc ((size + 2) * sizeof *new_environ);
+      if (! new_environ)
         return -1;
-      (void) memcpy ((void *) new_environ, (void *) environ,
-                     size * sizeof (char *));
-      new_environ[size] = (char *) string;
-      new_environ[size + 1] = NULL;
+      new_environ[0] = string;
+      memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ);
       free (last_environ);
       last_environ = new_environ;
       environ = new_environ;
     }
-  else
-    *ep = string;
 
   return 0;
+#endif
 }
diff --git a/lib/gltests/setenv.c b/lib/gltests/setenv.c
index 8201be2..995a0f2 100644
--- a/lib/gltests/setenv.c
+++ b/lib/gltests/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -15,14 +15,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #if !_LIBC
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the name == NULL test below.  */
+# define _GL_ARG_NONNULL(params)
+
 # define _GL_USE_STDLIB_ALLOC 1
 # include <config.h>
 #endif
 
-/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
-   optimizes away the name == NULL test below.  */
-#define _GL_ARG_NONNULL(params)
-
 #include <alloca.h>
 
 /* Specification.  */
diff --git a/lib/gltests/setlocale.c b/lib/gltests/setlocale.c
index 8a47cde..c729fa6 100644
--- a/lib/gltests/setlocale.c
+++ b/lib/gltests/setlocale.c
@@ -1,5 +1,5 @@
 /* Set the current locale.
-   Copyright (C) 2009, 2011-2012 Free Software Foundation, Inc.
+   Copyright (C) 2009, 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/lib/gltests/signature.h b/lib/gltests/signature.h
index d9d8b47..45a8e02 100644
--- a/lib/gltests/signature.h
+++ b/lib/gltests/signature.h
@@ -1,5 +1,5 @@
 /* Macro for checking that a function declaration is compliant.
-   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/lib/gltests/stdlib.in.h b/lib/gltests/stdlib.in.h
index 6555840..c955248 100644
--- a/lib/gltests/stdlib.in.h
+++ b/lib/gltests/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@
 
@@ -766,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/lib/gltests/sys_types.in.h b/lib/gltests/sys_types.in.h
index 8139d98..d7da356 100644
--- a/lib/gltests/sys_types.in.h
+++ b/lib/gltests/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/lib/gltests/test-alloca-opt.c b/lib/gltests/test-alloca-opt.c
index 6b9a4d7..d94e1d1 100644
--- a/lib/gltests/test-alloca-opt.c
+++ b/lib/gltests/test-alloca-opt.c
@@ -1,5 +1,5 @@
 /* Test of optional automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/lib/gltests/test-c-ctype.c b/lib/gltests/test-c-ctype.c
index a9cb655..c0aa662 100644
--- a/lib/gltests/test-c-ctype.c
+++ b/lib/gltests/test-c-ctype.c
@@ -1,5 +1,5 @@
 /* Test of character handling in C locale.
-   Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2005, 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/lib/gltests/test-c-strcasecmp.c b/lib/gltests/test-c-strcasecmp.c
index 1eb5958..26d9ca4 100644
--- a/lib/gltests/test-c-strcasecmp.c
+++ b/lib/gltests/test-c-strcasecmp.c
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   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/lib/gltests/test-c-strncasecmp.c b/lib/gltests/test-c-strncasecmp.c
index 479528b..075f15e 100644
--- a/lib/gltests/test-c-strncasecmp.c
+++ b/lib/gltests/test-c-strncasecmp.c
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   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/lib/gltests/test-environ.c b/lib/gltests/test-environ.c
index 972ed06..cb3d9f6 100644
--- a/lib/gltests/test-environ.c
+++ b/lib/gltests/test-environ.c
@@ -1,5 +1,5 @@
 /* Test of environ variable.
-   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/lib/gltests/test-iconv.c b/lib/gltests/test-iconv.c
index 333af2a..a39ca58 100644
--- a/lib/gltests/test-iconv.c
+++ b/lib/gltests/test-iconv.c
@@ -1,5 +1,5 @@
 /* Test of character set conversion.
-   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/lib/gltests/test-init.sh b/lib/gltests/test-init.sh
index a2825cc..6eb6b43 100755
--- a/lib/gltests/test-init.sh
+++ b/lib/gltests/test-init.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for init.sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
diff --git a/lib/gltests/test-intprops.c b/lib/gltests/test-intprops.c
index aeb1168..8b91a79 100644
--- a/lib/gltests/test-intprops.c
+++ b/lib/gltests/test-intprops.c
@@ -1,5 +1,5 @@
 /* Test intprops.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/lib/gltests/test-inttypes.c b/lib/gltests/test-inttypes.c
index 698d3dc..db1a97e 100644
--- a/lib/gltests/test-inttypes.c
+++ b/lib/gltests/test-inttypes.c
@@ -1,5 +1,5 @@
 /* Test of <inttypes.h> substitute.
-   Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/lib/gltests/test-locale.c b/lib/gltests/test-locale.c
index e884ea1..3fb7b85 100644
--- a/lib/gltests/test-locale.c
+++ b/lib/gltests/test-locale.c
@@ -1,5 +1,5 @@
 /* Test of <locale.h> substitute.
-   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/lib/gltests/test-localename.c b/lib/gltests/test-localename.c
index 37b76a3..deb59b1 100644
--- a/lib/gltests/test-localename.c
+++ b/lib/gltests/test-localename.c
@@ -1,5 +1,5 @@
 /* Test of gl_locale_name function and its variants.
-   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/lib/gltests/test-lock.c b/lib/gltests/test-lock.c
index 5cada7d..57392db 100644
--- a/lib/gltests/test-lock.c
+++ b/lib/gltests/test-lock.c
@@ -1,5 +1,5 @@
 /* Test of locking in multithreaded situations.
-   Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2005, 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/lib/gltests/test-malloca.c b/lib/gltests/test-malloca.c
index 9c7109c..7d5e62e 100644
--- a/lib/gltests/test-malloca.c
+++ b/lib/gltests/test-malloca.c
@@ -1,5 +1,5 @@
 /* Test of safe automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/lib/gltests/test-setenv.c b/lib/gltests/test-setenv.c
index 4752a11..0a53ac4 100644
--- a/lib/gltests/test-setenv.c
+++ b/lib/gltests/test-setenv.c
@@ -1,5 +1,5 @@
 /* Tests of setenv.
-   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/lib/gltests/test-setlocale1.c b/lib/gltests/test-setlocale1.c
index 08f9224..b20c037 100644
--- a/lib/gltests/test-setlocale1.c
+++ b/lib/gltests/test-setlocale1.c
@@ -1,5 +1,5 @@
 /* Test of setting the current locale.
-   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/lib/gltests/test-setlocale2.c b/lib/gltests/test-setlocale2.c
index 7416647..cad9e2f 100644
--- a/lib/gltests/test-setlocale2.c
+++ b/lib/gltests/test-setlocale2.c
@@ -1,5 +1,5 @@
 /* Test of setting the current locale.
-   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/lib/gltests/test-stdbool.c b/lib/gltests/test-stdbool.c
index c22ca1f..3c13ca2 100644
--- a/lib/gltests/test-stdbool.c
+++ b/lib/gltests/test-stdbool.c
@@ -1,5 +1,5 @@
 /* Test of <stdbool.h> substitute.
-   Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2002-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/lib/gltests/test-stddef.c b/lib/gltests/test-stddef.c
index d7237b3..f42b4e0 100644
--- a/lib/gltests/test-stddef.c
+++ b/lib/gltests/test-stddef.c
@@ -1,5 +1,5 @@
 /* Test of <stddef.h> substitute.
-   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/lib/gltests/test-stdint.c b/lib/gltests/test-stdint.c
index 23b2b28..1c559b0 100644
--- a/lib/gltests/test-stdint.c
+++ b/lib/gltests/test-stdint.c
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   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/lib/gltests/test-stdlib.c b/lib/gltests/test-stdlib.c
index 7eeb410..6d38156 100644
--- a/lib/gltests/test-stdlib.c
+++ b/lib/gltests/test-stdlib.c
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute.
-   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/lib/gltests/test-striconv.c b/lib/gltests/test-striconv.c
index cd8d8ef..c77dc6c 100644
--- a/lib/gltests/test-striconv.c
+++ b/lib/gltests/test-striconv.c
@@ -1,5 +1,5 @@
 /* Test of character set conversion.
-   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/lib/gltests/test-strverscmp.c b/lib/gltests/test-strverscmp.c
index adf9bbf..1498ccb 100644
--- a/lib/gltests/test-strverscmp.c
+++ b/lib/gltests/test-strverscmp.c
@@ -1,5 +1,5 @@
 /* Test of strverscmp() function.
-   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/lib/gltests/test-sys_types.c b/lib/gltests/test-sys_types.c
index c2af992..1045de7 100644
--- a/lib/gltests/test-sys_types.c
+++ b/lib/gltests/test-sys_types.c
@@ -1,5 +1,5 @@
 /* Test of <sys/types.h> substitute.
-   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/lib/gltests/test-sys_wait.h b/lib/gltests/test-sys_wait.h
index d3726df..d78b19e 100644
--- a/lib/gltests/test-sys_wait.h
+++ b/lib/gltests/test-sys_wait.h
@@ -1,5 +1,5 @@
 /* Test of macros shared between <sys/wait.h> and <stdlib.h>.
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/lib/gltests/test-thread_create.c b/lib/gltests/test-thread_create.c
index 0f86771..b47bb1b 100644
--- a/lib/gltests/test-thread_create.c
+++ b/lib/gltests/test-thread_create.c
@@ -1,5 +1,5 @@
 /* Test of gl_thread_create () macro.
-   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/lib/gltests/test-thread_self.c b/lib/gltests/test-thread_self.c
index 707f7fe..27db4b2 100644
--- a/lib/gltests/test-thread_self.c
+++ b/lib/gltests/test-thread_self.c
@@ -1,5 +1,5 @@
 /* Test of gl_thread_self () macro.
-   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/lib/gltests/test-unistd.c b/lib/gltests/test-unistd.c
index e53fd7a..5470985 100644
--- a/lib/gltests/test-unistd.c
+++ b/lib/gltests/test-unistd.c
@@ -1,5 +1,5 @@
 /* Test of <unistd.h> substitute.
-   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/lib/gltests/test-unsetenv.c b/lib/gltests/test-unsetenv.c
index 926526d..c369e2a 100644
--- a/lib/gltests/test-unsetenv.c
+++ b/lib/gltests/test-unsetenv.c
@@ -1,5 +1,5 @@
 /* Tests of unsetenv.
-   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/lib/gltests/test-verify.c b/lib/gltests/test-verify.c
index 5ab9c58..1056b4e 100644
--- a/lib/gltests/test-verify.c
+++ b/lib/gltests/test-verify.c
@@ -1,6 +1,6 @@
 /* Test the "verify" module.
 
-   Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/gltests/unistd.in.h b/lib/gltests/unistd.in.h
index 6171f77..2ea9af4 100644
--- a/lib/gltests/unistd.in.h
+++ b/lib/gltests/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,6 +112,7 @@
 /* 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
 
diff --git a/lib/gltests/unistr/test-u8-mbtoucr.c 
b/lib/gltests/unistr/test-u8-mbtoucr.c
index 9e38885..763d931 100644
--- a/lib/gltests/unistr/test-u8-mbtoucr.c
+++ b/lib/gltests/unistr/test-u8-mbtoucr.c
@@ -1,5 +1,5 @@
 /* Test of u8_mbtoucr() function.
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/lib/gltests/unistr/test-u8-uctomb.c 
b/lib/gltests/unistr/test-u8-uctomb.c
index 988808e..b0ecb30 100644
--- a/lib/gltests/unistr/test-u8-uctomb.c
+++ b/lib/gltests/unistr/test-u8-uctomb.c
@@ -1,5 +1,5 @@
 /* Test of u8_uctomb() function.
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 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/lib/gltests/unsetenv.c b/lib/gltests/unsetenv.c
index ddbe9a4..c58c82f 100644
--- a/lib/gltests/unsetenv.c
+++ b/lib/gltests/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,12 +14,12 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <config.h>
-
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the name == NULL test below.  */
 #define _GL_ARG_NONNULL(params)
 
+#include <config.h>
+
 /* Specification.  */
 #include <stdlib.h>
 
diff --git a/lib/gltests/verify.h b/lib/gltests/verify.h
index 0c320b1..03492ef 100644
--- a/lib/gltests/verify.h
+++ b/lib/gltests/verify.h
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
+   Copyright (C) 2005-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
@@ -31,7 +31,9 @@
    Use this only with GCC.  If we were willing to slow 'configure'
    down we could also use it with other compilers, but since this
    affects only the quality of diagnostics, why bother?  */
-# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined 
__cplusplus
+# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+      && (201112L <= __STDC_VERSION__  || !defined __STRICT_ANSI__) \
+      && !defined __cplusplus)
 #  define _GL_HAVE__STATIC_ASSERT 1
 # endif
 /* The condition (99 < __GNUC__) is temporary, until we know about the
diff --git a/lib/gltests/wchar.in.h b/lib/gltests/wchar.in.h
index f9bc30c..b6e4362 100644
--- a/lib/gltests/wchar.in.h
+++ b/lib/gltests/wchar.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   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/lib/idn-free.c b/lib/idn-free.c
index 651212b..0e84ac3 100644
--- a/lib/idn-free.c
+++ b/lib/idn-free.c
@@ -1,5 +1,5 @@
 /* idn-free.h --- Invoke the free function to release memory
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/idn-free.h b/lib/idn-free.h
index 58f3a2a..982713f 100644
--- a/lib/idn-free.h
+++ b/lib/idn-free.h
@@ -1,5 +1,5 @@
 /* idn-free.h --- Invoke the free function to release memory
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/idna.c b/lib/idna.c
index 87eefb3..97a6e0f 100644
--- a/lib/idna.c
+++ b/lib/idna.c
@@ -1,5 +1,5 @@
 /* idna.c --- Prototypes for Internationalized Domain Name library.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/idna.h b/lib/idna.h
index 2b58f8a..f5fdbf9 100644
--- a/lib/idna.h
+++ b/lib/idna.h
@@ -1,5 +1,5 @@
 /* idna.h --- Prototypes for Internationalized Domain Name library.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/libidn.map b/lib/libidn.map
index 07a4e80..6b0b007 100644
--- a/lib/libidn.map
+++ b/lib/libidn.map
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2012 Simon Josefsson.
+# Copyright (C) 2009-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/lib/nfkc.c b/lib/nfkc.c
index 113ce3c..490b213 100644
--- a/lib/nfkc.c
+++ b/lib/nfkc.c
@@ -1,5 +1,5 @@
 /* nfkc.c --- Unicode normalization utilities.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/pr29.c b/lib/pr29.c
index fcf798d..495babe 100644
--- a/lib/pr29.c
+++ b/lib/pr29.c
@@ -1,5 +1,5 @@
 /* pr29.h --- Detect strings that are non-idempotent under NFKC in Unicode 3.2.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/pr29.h b/lib/pr29.h
index bf1bba1..4c8c960 100644
--- a/lib/pr29.h
+++ b/lib/pr29.h
@@ -1,5 +1,5 @@
 /* pr29.h --- Detect strings which are non-idempotent under NFKC.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/profiles.c b/lib/profiles.c
index 912ee43..8f12e7d 100644
--- a/lib/profiles.c
+++ b/lib/profiles.c
@@ -1,5 +1,5 @@
 /* profiles.c --- Definitions of stringprep profiles.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/punycode.c b/lib/punycode.c
index 9037f51..b2ebfd2 100644
--- a/lib/punycode.c
+++ b/lib/punycode.c
@@ -1,5 +1,5 @@
 /* punycode.c --- Implementation of punycode used to ASCII encode IDN's.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/punycode.h b/lib/punycode.h
index 0fea6c9..08e04dc 100644
--- a/lib/punycode.h
+++ b/lib/punycode.h
@@ -1,5 +1,5 @@
 /* punycode.h --- Declarations for punycode functions.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/strerror-idna.c b/lib/strerror-idna.c
index 2ef181d..4ae84a1 100644
--- a/lib/strerror-idna.c
+++ b/lib/strerror-idna.c
@@ -1,5 +1,5 @@
 /* strerror-idna.c --- Convert IDNA errors into text.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/strerror-pr29.c b/lib/strerror-pr29.c
index 003ed59..40045a7 100644
--- a/lib/strerror-pr29.c
+++ b/lib/strerror-pr29.c
@@ -1,5 +1,5 @@
 /* strerror-pr29.c --- Convert PR29 errors into text.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/strerror-punycode.c b/lib/strerror-punycode.c
index 856b808..edb61ef 100644
--- a/lib/strerror-punycode.c
+++ b/lib/strerror-punycode.c
@@ -1,5 +1,5 @@
 /* strerror-punycode.c --- Convert punycode errors into text.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/strerror-stringprep.c b/lib/strerror-stringprep.c
index cb6f636..90ce835 100644
--- a/lib/strerror-stringprep.c
+++ b/lib/strerror-stringprep.c
@@ -1,5 +1,5 @@
 /* strerror-stringprep.c --- Convert stringprep errors into text.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/strerror-tld.c b/lib/strerror-tld.c
index 7c87fb7..5477c6c 100644
--- a/lib/strerror-tld.c
+++ b/lib/strerror-tld.c
@@ -1,5 +1,5 @@
 /* strerror-tld.c --- Convert TLD errors into text.
-   Copyright (C) 2004-2012 Simon Josefsson
+   Copyright (C) 2004-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/stringprep.c b/lib/stringprep.c
index 4c85970..7b59127 100644
--- a/lib/stringprep.c
+++ b/lib/stringprep.c
@@ -1,5 +1,5 @@
 /* stringprep.c --- Core stringprep implementation.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/stringprep.h b/lib/stringprep.h
index 7c55d48..cb96e42 100644
--- a/lib/stringprep.h
+++ b/lib/stringprep.h
@@ -1,5 +1,5 @@
 /* stringprep.h --- Header file for stringprep functions.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/tld.c b/lib/tld.c
index 166916f..34566fa 100644
--- a/lib/tld.c
+++ b/lib/tld.c
@@ -1,6 +1,6 @@
 /* tld.c --- Declarations for TLD restriction checking.
-   Copyright (C) 2004-2012 Simon Josefsson.
-   Copyright (C) 2003-2012 Free Software Foundation, Inc.
+   Copyright (C) 2004-2013 Simon Josefsson.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
 
    Author: Thomas Jacob, Internet24.de
 
diff --git a/lib/tld.h b/lib/tld.h
index 4d23e6c..22921b7 100644
--- a/lib/tld.h
+++ b/lib/tld.h
@@ -1,6 +1,6 @@
 /* tld.h --- Declarations for TLD restriction checking.
-   Copyright (C) 2004-2012 Simon Josefsson.
-   Copyright (C) 2003-2012 Free Software Foundation, Inc.
+   Copyright (C) 2004-2013 Simon Josefsson.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
 
    Author: Thomas Jacob, Internet24.de
 
diff --git a/lib/toutf8.c b/lib/toutf8.c
index c31a826..64b7e5e 100644
--- a/lib/toutf8.c
+++ b/lib/toutf8.c
@@ -1,5 +1,5 @@
 /* toutf8.c --- Convert strings from system locale into UTF-8.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/lib/version.c b/lib/version.c
index 843f4b2..d9d3ed7 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -1,5 +1,5 @@
 /* version.c --- Version handling.
-   Copyright (C) 2002-2012 Simon Josefsson
+   Copyright (C) 2002-2013 Simon Josefsson
 
    This file is part of GNU Libidn.
 
diff --git a/libc/README b/libc/README
index 725bd10..0828fd3 100644
--- a/libc/README
+++ b/libc/README
@@ -1,5 +1,5 @@
 Libidn libc/README -- Instructions for building as a GNU Libc add-on.
-Copyright (C) 2003-2012 Simon Josefsson
+Copyright (C) 2003-2013 Simon Josefsson
 See the end for copying conditions.
 
 GNU Libidn is now part of GNU Libc, so the stand-alone patch and
diff --git a/libc/example.c b/libc/example.c
index 062efd2..1292c28 100644
--- a/libc/example.c
+++ b/libc/example.c
@@ -1,5 +1,5 @@
 /* example.c --- Example code showing how to use IDN enabled getaddrinfo().
- * Copyright (C) 2003-2012 Simon Josefsson
+ * Copyright (C) 2003-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/libc/getaddrinfo-idn.txt b/libc/getaddrinfo-idn.txt
index 60f2fc1..38835ca 100644
--- a/libc/getaddrinfo-idn.txt
+++ b/libc/getaddrinfo-idn.txt
@@ -1,5 +1,5 @@
 Libidn getaddrinfo-idn.txt -- Proposal for IDN support in POSIX getaddrinfo.
-Copyright (C) 2003-2012 Simon Josefsson
+Copyright (C) 2003-2013 Simon Josefsson
 See the end for copying conditions.
 
 Background
diff --git a/libidn.pc.in b/libidn.pc.in
index a69d5d3..426a0fa 100644
--- a/libidn.pc.in
+++ b/libidn.pc.in
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a pkg-config metadata file.
-# Copyright 2002-2012 Simon Josefsson
+# Copyright 2002-2013 Simon Josefsson
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
diff --git a/m4/update-header-version.m4 b/m4/update-header-version.m4
index 27f9d03..3bcad35 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, 2010, 2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-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/maint.mk b/maint.mk
index 93c2508..c1b786f 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
@@ -809,7 +809,7 @@ sc_prohibit_always_true_header_tests:
          $(_sc_search_regexp)
 
 sc_prohibit_defined_have_decl_tests:
-       @prohibit='#[    ]*if(n?def|.*\<defined)\>[      (]+HAVE_DECL_' \
+       @prohibit='(#[   ]*ifn?def|\<defined)\>[         (]+HAVE_DECL_' \
        halt='HAVE_DECL macros are always defined'                      \
          $(_sc_search_regexp)
 
@@ -1370,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;                                                  \
@@ -1388,7 +1389,8 @@ 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")"'                       \
diff --git a/po/eo.po.in b/po/eo.po.in
index a596539..eb5fd17 100644
--- a/po/eo.po.in
+++ b/po/eo.po.in
@@ -1,172 +1,164 @@
-# Translation of 'libidn' messages to Esperanto.
-# Esperantaj mesaĝoj por libidn.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Esperanto translations for GNU libidn.
+# Copyright (C) 2012 Free Software Foundation, Inc.
 # This file is distributed under the same license as the libidn package.
-# Edmund GRIMLEY EVANS <address@hidden>, 2004-2005, 2007-2008.
 #
+# Tradukoj kiuj komencas per "##" estas mesaĝoj por erarspurado;
+# ili devus malesti en ĉi tiu dosiero.
+#
+# Edmund GRIMLEY EVANS <address@hidden>, 2004, 2005, 2007, 2008.
+# Benno Schulenberg <address@hidden>, 2012.
 msgid ""
 msgstr ""
-"Project-Id-Version: libidn 1.9\n"
+"Project-Id-Version: libidn 1.25\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2008-07-01 18:15+0200\n"
-"PO-Revision-Date: 2008-09-01 09:40+0100\n"
-"Last-Translator: Edmund GRIMLEY EVANS <address@hidden>\n"
+"POT-Creation-Date: 2012-05-23 10:37+0200\n"
+"PO-Revision-Date: 2012-12-17 16:42+0100\n"
+"Last-Translator: Benno Schulenberg <address@hidden>\n"
 "Language-Team: Esperanto <address@hidden>\n"
+"Language: eo\n"
 "MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Lokalize 1.0\n"
 
-#: lib/strerror-idna.c:74 lib/strerror-pr29.c:58 lib/strerror-punycode.c:58
-#: lib/strerror-stringprep.c:78 lib/strerror-tld.c:60
+#: lib/strerror-idna.c:82 lib/strerror-pr29.c:66 lib/strerror-punycode.c:66
+#: lib/strerror-stringprep.c:86 lib/strerror-tld.c:68
 msgid "Success"
 msgstr "Sukceso"
 
-#: lib/strerror-idna.c:78 lib/strerror-pr29.c:66
+#: lib/strerror-idna.c:86 lib/strerror-pr29.c:74
 msgid "String preparation failed"
-msgstr "Pretigo de signoĉeno malsukcesis"
+msgstr "Malsukcesis pretigo de signoĉeno"
 
-#: lib/strerror-idna.c:82
+#: lib/strerror-idna.c:90
 msgid "Punycode failed"
-msgstr "Punycode malsukcesis"
+msgstr "Malsukcesis 'Punycode'"
 
-#: lib/strerror-idna.c:86
+#: lib/strerror-idna.c:94
 msgid "Non-digit/letter/hyphen in input"
-msgstr "Signo ne-cifero/litero/dividstreko en enigo"
+msgstr "Litero/necifero/streketo en enigo"
 
-#: lib/strerror-idna.c:90
+#: lib/strerror-idna.c:98
 msgid "Forbidden leading or trailing minus sign (`-')"
 msgstr "Malpermesita minuso ('-') ĉe komenco aŭ fino"
 
-#: lib/strerror-idna.c:94
+#: lib/strerror-idna.c:102
 msgid "Output would be too large or too small"
 msgstr "Eligo estus tro granda aÅ­ tro malgranda"
 
-#: lib/strerror-idna.c:98
+#: lib/strerror-idna.c:106
 msgid "Input does not start with ACE prefix (`xn--')"
 msgstr "Enigo ne komenciĝas per ACE-prefikso ('xn--')"
 
-#: lib/strerror-idna.c:102
+#: lib/strerror-idna.c:110
 msgid "String not idempotent under ToASCII"
-msgstr "Ĉeno ŝanĝiĝas ĉe dua apliko de ToASCII"
+msgstr "Ĉeno ŝanĝiĝas ĉe dua apliko de 'ToASCII'"
 
-#: lib/strerror-idna.c:106
+#: lib/strerror-idna.c:114
 msgid "Input already contain ACE prefix (`xn--')"
 msgstr "Enigo jam havas ACE-prefikson ('xn--')"
 
-#: lib/strerror-idna.c:110 lib/strerror-tld.c:76
+#: lib/strerror-idna.c:118 lib/strerror-tld.c:84
 msgid "System iconv failed"
-msgstr "Sistema iconv malsukcesis"
+msgstr "Malsukcesis sistemfunkcio 'iconv()'"
 
-#: lib/strerror-idna.c:114 lib/strerror-stringprep.c:122 lib/strerror-tld.c:72
+#: lib/strerror-idna.c:122 lib/strerror-stringprep.c:130 lib/strerror-tld.c:80
 msgid "Cannot allocate memory"
-msgstr "Ne povas akiri memoron"
+msgstr "Mankas sufiĉa memoro"
 
-#: lib/strerror-idna.c:118
+#: lib/strerror-idna.c:126
 msgid "System dlopen failed"
-msgstr "Sistema dlopen malsukcesis"
+msgstr "Malsukcesis sistemfunkcio 'dlopen()'"
 
-#: lib/strerror-idna.c:122 lib/strerror-pr29.c:70 lib/strerror-punycode.c:74
-#: lib/strerror-stringprep.c:126 lib/strerror-tld.c:84
+#: lib/strerror-idna.c:130 lib/strerror-pr29.c:78 lib/strerror-punycode.c:82
+#: lib/strerror-stringprep.c:134 lib/strerror-tld.c:92
 msgid "Unknown error"
 msgstr "Nekonata eraro"
 
-#: lib/strerror-pr29.c:62
+#: lib/strerror-pr29.c:70
 msgid "String not idempotent under Unicode NFKC normalization"
-msgstr "Ĉeno ŝanĝiĝas ĉe dua apliko de unikoda NFKC-normigo"
+msgstr "Ĉeno ŝanĝiĝas ĉe dua apliko de Unikoda NFKC-normigo"
 
-#: lib/strerror-punycode.c:62
+#: lib/strerror-punycode.c:70
 msgid "Invalid input"
 msgstr "Nevalida enigo"
 
-#: lib/strerror-punycode.c:66 lib/strerror-stringprep.c:102
+#: lib/strerror-punycode.c:74 lib/strerror-stringprep.c:110
 msgid "Output would exceed the buffer space provided"
 msgstr "Eligo estus tro granda por donita bufro"
 
-#: lib/strerror-punycode.c:70
+#: lib/strerror-punycode.c:78
 msgid "String size limit exceeded"
-msgstr "Signoĉena grandolimo superita"
+msgstr "Limo de signoĉena grando transpasiĝis"
 
-#: lib/strerror-stringprep.c:82
+#: lib/strerror-stringprep.c:90
 msgid "Forbidden unassigned code points in input"
 msgstr "Malpermesita neatribuita kodero en enigo"
 
-#: lib/strerror-stringprep.c:86
+#: lib/strerror-stringprep.c:94
 msgid "Prohibited code points in input"
 msgstr "Malpermesita kodero en enigo"
 
-#: lib/strerror-stringprep.c:90
+#: lib/strerror-stringprep.c:98
 msgid "Conflicting bidirectional properties in input"
 msgstr "Malkongruaj dudirektaj trajtoj en enigo"
 
-#: lib/strerror-stringprep.c:94
+#: lib/strerror-stringprep.c:102
 msgid "Malformed bidirectional string"
 msgstr "Misformita dudirekta ĉeno"
 
-#: lib/strerror-stringprep.c:98
+#: lib/strerror-stringprep.c:106
 msgid "Prohibited bidirectional code points in input"
 msgstr "Malpermesita dudirekta kodero en enigo"
 
-#: lib/strerror-stringprep.c:106
+#: lib/strerror-stringprep.c:114
 msgid "Error in stringprep profile definition"
-msgstr "Eraro en difino de stringprep-profilo"
+msgstr "Eraro en difino de ĉenopretig-profilo"
 
-#: lib/strerror-stringprep.c:110
+#: lib/strerror-stringprep.c:118
 msgid "Flag conflict with profile"
 msgstr "Flaga malkongruo kun profilo"
 
-#: lib/strerror-stringprep.c:114
+#: lib/strerror-stringprep.c:122
 msgid "Unknown profile"
 msgstr "Nekonata profilo"
 
-#: lib/strerror-stringprep.c:118
+#: lib/strerror-stringprep.c:126
 msgid "Unicode normalization failed (internal error)"
-msgstr "Unikoda normigo malsukcesis (interna eraro)"
+msgstr "Malsukcesis Unikoda normigo (**interna programeraro**)"
 
-#: lib/strerror-tld.c:64
+#: lib/strerror-tld.c:72
 msgid "Code points prohibited by top-level domain"
-msgstr "Koderoj malpermesitaj de supera retregiono"
+msgstr "Koderoj kiuj malpermesiĝas de supera retregiono"
 
-#: lib/strerror-tld.c:68
+#: lib/strerror-tld.c:76
 msgid "Missing input"
 msgstr "Mankanta enigo"
 
-#: lib/strerror-tld.c:80
+#: lib/strerror-tld.c:88
 msgid "No top-level domain found in input"
-msgstr "Nenia supera retregiono trovita en enigo"
-
-#. TRANSLATORS: The placeholder indicates the bug-reporting address
-#. for this package.  Please add _another line_ saying
-#. "Report translation bugs to <...>\n" with the address for translation
-#. bugs (typically your translation team's web or email address).
-#: src/idn.c:68
-#, c-format
-msgid ""
-"\n"
-"Report bugs to <%s>.\n"
-msgstr ""
-"\n"
-"Raportu cimojn al <%s>.\n"
-"Raportu erarojn en la traduko al <address@hidden>.\n"
+msgstr "Neniu supera retregiono troviĝis en enigo"
 
-#: src/idn.c:75
+#: src/idn.c:65
 #, c-format
 msgid "Try `%s --help' for more information.\n"
-msgstr "Provu '%s --help' por pliaj informoj.\n"
+msgstr "Tajpu '%s --help' por pli da informoj.\n"
 
-#: src/idn.c:79
+#: src/idn.c:69
 #, c-format
 msgid "Usage: %s [OPTION]... [STRINGS]...\n"
-msgstr "Uzado: %s [OPCIO]... [ĈENOJ]...\n"
+msgstr "Uzmaniero:  %s [OPCIO...] [ĈENO...]\n"
 
-#: src/idn.c:82
+#: src/idn.c:72
 msgid ""
 "Internationalized Domain Name (IDN) convert STRINGS, or standard input.\n"
 "\n"
 msgstr ""
-"Internaciigitaj retnomoj (IDN) konverti ĈENOJn, aŭ la normalan enigon.\n"
+"Konvertas ĈENO(j)n (aŭ ĉefenigujon) laŭ la internaciigitaj retnomaj 
reguloj.\n"
 "\n"
 
-#: src/idn.c:86
+#: src/idn.c:76
 msgid ""
 "Command line interface to the internationalized domain name library.\n"
 "\n"
@@ -181,24 +173,24 @@ msgid ""
 msgstr ""
 "Komandlinia interfaco al la biblioteko por internaciigitaj retnomoj.\n"
 "\n"
-"Ĉiuj ĉenoj estu koditaj per la preferata signaro de via\n"
-"lokaĵaro. Uzu '--debug' por eltrovi, kiu ĝi estas. Vi\n"
-"povas specifi alian signaron per la media variablo CHARSET.\n"
+"Ĉiuj ĉenoj estu koditaj per la preferata signaro de via lokaĵaro.\n"
+"Uzu '--debug' por eltrovi kiu ĝi estas.  Vi povas indiki alian\n"
+"signaron per la media variablo CHARSET.\n"
 "\n"
-"Por trakti ĉenon, kiu komenciĝas per '-', ekzemple '-foo', uzu '--'\n"
-"por indiki la finon de la parametroj, kiel en 'idn --quiet -a -- -foo'.\n"
-"Devigaj argumentoj por longaj opcioj estas devigaj ankaÅ­ por mallongaj\n"
-"opcioj.\n"
+"Por trakti ĉenon kiu komenciĝas per '-' (ekzemple '-foo'), uzu '--' por\n"
+"indiki la finon de la parametroj, kiel en «idn --quiet -a -- -foo».\n"
+"\n"
+"(Endaj argumentoj por longaj opcioj ankaÅ­ endas por la mallongaj.)\n"
 
-#: src/idn.c:98
+#: src/idn.c:88
 msgid ""
 "  -h, --help               Print help and exit\n"
 "  -V, --version            Print version and exit\n"
 msgstr ""
-"  -h, --help               Montri helpon kaj eliri\n"
-"  -V, --version            Montri version kaj eliri\n"
+"  -h, --help               montri ĉi tiun helpon kaj eliri\n"
+"  -V, --version            montri programversion kaj eliri\n"
 
-#: src/idn.c:102
+#: src/idn.c:92
 msgid ""
 "  -s, --stringprep         Prepare string according to nameprep profile\n"
 "  -d, --punycode-decode    Decode Punycode\n"
@@ -206,58 +198,58 @@ msgid ""
 "  -a, --idna-to-ascii      Convert to ACE according to IDNA (default mode)\n"
 "  -u, --idna-to-unicode    Convert from ACE according to IDNA\n"
 msgstr ""
-"  -s, --stringprep         Pretigi ĉenon laŭ la profilo nameprop\n"
-"  -d, --punycode-decode    Malkodi Punycode\n"
-"  -e, --punycode-encode    Kodi Punycode\n"
-"  -a, --idna-to-ascii      Konverti al ACE laŭ IDNA (implicita reĝimo)\n"
-"  -u, --idna-to-unicode    Konverti de ACE laÅ­ IDNA\n"
+"  -s, --stringprep         pretigi ĉenon laŭ la profilo 'Nameprep'\n"
+"  -d, --punycode-decode    malkodi 'Punycode'\n"
+"  -e, --punycode-encode    kodi 'Punycode'\n"
+"  -a, --idna-to-ascii      konverti al ACE laŭ IDNA (la implicita reĝimo)\n"
+"  -u, --idna-to-unicode    konverti de ACE laÅ­ IDNA\n"
 
-#: src/idn.c:109
+#: src/idn.c:99
 msgid ""
-"      --allow-unassigned   Toggle IDNA AllowUnassigned flag\n"
-"      --usestd3asciirules  Toggle IDNA UseSTD3ASCIIRules flag\n"
+"      --allow-unassigned   Toggle IDNA AllowUnassigned flag (default off)\n"
+"      --usestd3asciirules  Toggle IDNA UseSTD3ASCIIRules flag (default off)\n"
 msgstr ""
-"      --allow-unassigned   Ŝanĝi la flagon IDNA AllowUnassigned\n"
-"      --usestd3asciirules  Ŝanĝi la flagon IDNA UseSTD3ASCIIRules\n"
+"      --allow-unassigned   enŝalti la IDNA-flagon 'AllowUnassigned'\n"
+"      --usestd3asciirules  enŝalti la IDNA-flagon 'UseSTD3ASCIIRules'\n"
 
-#: src/idn.c:113
+#: src/idn.c:103
 msgid ""
-"  -t, --tld                Check string for TLD specific rules\n"
+"      --no-tld             Don't check string for TLD specific rules\n"
 "                             Only for --idna-to-ascii and --idna-to-unicode\n"
 msgstr ""
-"  -t, --tld                Kontroli ĉeno pri TLD-specifaj reguloj\n"
-"                             Nur por --idna-to-ascii kaj --idna-to-unicode\n"
+"      --no-tld             ne kontroli ĉenon pri TLD-specifaj reguloj;\n"
+"                             nur por '--idna-to-ascii' kaj 
'--idna-to-unicode'\n"
 
-#: src/idn.c:117
+#: src/idn.c:107
 msgid "  -n, --nfkc               Normalize string according to Unicode v3.2 
NFKC\n"
-msgstr "  -n, --nfkc               Normigi signoĉenon laŭ Unikodo v3.2 
NFKC\n"
+msgstr "  -n, --nfkc               normigi signoĉenon laŭ Unikodo v3.2 
NFKC\n"
 
-#: src/idn.c:120
+#: src/idn.c:110
 msgid ""
 "  -p, --profile=STRING     Use specified stringprep profile instead\n"
 "                             Valid stringprep profiles: `Nameprep',\n"
 "                             `iSCSI', `Nodeprep', `Resourceprep', \n"
 "                             `trace', `SASLprep'\n"
 msgstr ""
-"  -p, --profile=ĈENO       Uzi specifitan stringprep-profilon anstataŭe\n"
-"                             Validaj stringprep-profiloj: 'Nameprep',\n"
-"                             'iSCSI', 'Nodeprep', 'Resourceprep',\n"
-"                             'trace', 'SASLprep'\n"
+"  -p, --profile=NOMO       uzi ĉi tiun ĉenopretig-profilon anstataŭe;\n"
+"                             validaj ĉenopretig-profiloj estas:\n"
+"                             'Nameprep', 'iSCSI', 'Nodeprep',\n"
+"                             'Resourceprep', 'trace', 'SASLprep'\n"
 
-#: src/idn.c:126
+#: src/idn.c:116
 msgid ""
 "      --debug              Print debugging information\n"
 "      --quiet              Silent operation\n"
 msgstr ""
-"      --debug              Montri informojn por erarspurado\n"
-"      --quiet              Silenta funkciado\n"
+"      --debug              montri informojn por helpi al erarspurado\n"
+"      --quiet              funkcii silente\n"
 
-#: src/idn.c:176
+#: src/idn.c:172
 #, c-format
-msgid "Only one of -s, -e, -d, -a, -u or -n can be specified."
-msgstr "Nur unu el -s, -e, -d, -a, -u aÅ­ -n povas esti donita."
+msgid "only one of -s, -e, -d, -a, -u or -n can be specified"
+msgstr "nur unu el la opcioj '-s', '-e', '-d', '-a', '-u' aÅ­ '-n' povas esti 
indikata"
 
-#: src/idn.c:184
+#: src/idn.c:182
 #, c-format
 msgid "Charset `%s'.\n"
 msgstr "Signaro '%s'.\n"
@@ -265,89 +257,93 @@ msgstr "Signaro '%s'.\n"
 #: src/idn.c:187
 #, c-format
 msgid "Type each input string on a line by itself, terminated by a newline 
character.\n"
-msgstr ""
-"Tajpu ĉiun enigan ĉenon en propra linio, kun linifina signo ĉe la\n"
-"fino.\n"
+msgstr "Tajpu ĉiun enigan ĉenon en propra linio, kun linifina signo ĉe la 
fino.\n"
 
 #: src/idn.c:202
 #, c-format
-msgid "Input error"
-msgstr "Enig-eraro"
+msgid "input error"
+msgstr "enig-eraro"
 
 #: src/idn.c:212 src/idn.c:274 src/idn.c:357 src/idn.c:434 src/idn.c:515
 #, c-format
-msgid "Could not convert from %s to UTF-8."
-msgstr "Ne povis konverti de %s al UTF-8."
+msgid "could not convert from %s to UTF-8"
+msgstr "malsukcesis konverti de %s al UTF-8"
 
 #: src/idn.c:220 src/idn.c:245 src/idn.c:281 src/idn.c:498 src/idn.c:527
 #: src/idn.c:551
 #, c-format
-msgid "Could not convert from UTF-8 to UCS-4."
-msgstr "Ne povis konverti de UTF-8 al UCS-4."
+msgid "could not convert from UTF-8 to UCS-4"
+msgstr "malsukcesis konverti de UTF-8 al UCS-4"
 
 #: src/idn.c:237
 #, c-format
 msgid "stringprep_profile: %s"
-msgstr "stringprep_profile: %s"
+msgstr "## stringprep_profile(): %s"
 
 #: src/idn.c:260 src/idn.c:302 src/idn.c:345 src/idn.c:503 src/idn.c:564
 #, c-format
-msgid "Could not convert from UTF-8 to %s."
-msgstr "Ne povis konverti de UTF-8 al %s."
+msgid "could not convert from UTF-8 to %s"
+msgstr "malsukcesis konverti de UTF-8 al %s"
 
 #: src/idn.c:295
 #, c-format
 msgid "punycode_encode: %s"
-msgstr "punycode_encode: %s"
+msgstr "## punycode_encode(): %s"
+
+#: src/idn.c:317
+msgid "malloc"
+msgstr "mankas sufiĉa memoro"
 
 #: src/idn.c:323
 #, c-format
 msgid "punycode_decode: %s"
-msgstr "punycode_decode: %s"
+msgstr "## punycode_decode(): %s"
 
 #: src/idn.c:340 src/idn.c:364 src/idn.c:442
 #, c-format
-msgid "Could not convert from UCS-4 to UTF-8."
-msgstr "Ne povis konverti de UCS-4 al UTF-8."
+msgid "could not convert from UCS-4 to UTF-8"
+msgstr "malsukcesis konverti de UCS-4 al UTF-8"
 
 #: src/idn.c:381
 #, c-format
 msgid "idna_to_ascii_4z: %s"
-msgstr "idna_to_ascii_4z: %s"
+msgstr "## idna_to_ascii_4z(): %s"
 
 #: src/idn.c:395
 #, c-format
 msgid "idna_to_unicode_8z4z (TLD): %s"
-msgstr "idna_to_unicode_8z4z (TLD): %s"
+msgstr "## idna_to_unicode_8z4z (TLD): %s"
 
 #: src/idn.c:409 src/idn.c:482
 #, c-format
 msgid "tld_check_4z (position %lu): %s"
-msgstr "tld_check_4z (loko %lu): %s"
+msgstr "## tld_check_4z (pozicio %lu): %s"
 
 #: src/idn.c:412 src/idn.c:488
 #, c-format
 msgid "tld_check_4z: %s"
-msgstr "tld_check_4z: %s"
+msgstr "## tld_check_4z(): %s"
 
 #: src/idn.c:461
 #, c-format
 msgid "idna_to_unicode_8z4z: %s"
-msgstr "idna_to_unicode_8z4z: %s"
+msgstr "## idna_to_unicode_8z4z(): %s"
 
 #: src/idn.c:540
 #, c-format
-msgid "Could not do NFKC normalization."
-msgstr "Ne povis fari NFKC-normigon."
+msgid "could not do NFKC normalization"
+msgstr "malsukcesis fari NFKC-normigon"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <%s>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Raportu programmisojn al <%s>.\n"
+#~ "Raportu tradukerarojn al <address@hidden>.\n"
 
 #~ msgid "input[%lu] = U+%04x\n"
 #~ msgstr "enigo[%lu] = U+%04x\n"
 
 #~ msgid "output[%lu] = U+%04x\n"
 #~ msgstr "eligo[%lu] = U+%04x\n"
-
-#~ msgid "malloc"
-#~ msgstr "malloc"
-
-#~ msgid "tld[%lu] = U+%04x\n"
-#~ msgstr "tld[%lu] = U+%04x\n"
diff --git a/pom.xml.in b/pom.xml.in
deleted file mode 100644
index 26d53ac..0000000
--- a/pom.xml.in
+++ /dev/null
@@ -1,44 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.gnu.inet</groupId>
-  <artifactId>libidn</artifactId>
-  <name>GNU IDN Library</name>
-  <version>@VERSION@</version>
-  <description>
-    GNU Libidn is a fully documented implementation of the Stringprep,
-    Punycode and IDNA specifications. Libidn's purpose is to encode
-    and decode internationalized domain names.
-  </description>
-  <url>http://www.gnu.org/software/libidn/</url>
-  <inceptionYear>2002</inceptionYear>
-  <licenses>
-    <license>
-      <name>GNU Lesser General Public License version 3.0 or later</name>
-      <url>http://www.gnu.org/licenses/licenses.html</url>
-      <distribution>repo</distribution>
-    </license>
-  </licenses>
-  <scm>
-    <connection>scm:git:git://git.savannah.gnu.org/libidn.git</connection>
-    <url>http://git.savannah.gnu.org/gitweb/?p=libidn.git</url>
-  </scm>
-  <organization>
-    <name>GNU</name>
-    <url>http://www.gnu.org/</url>
-  </organization>
-  <build>
-    <sourceDirectory>${project.basedir}/java</sourceDirectory>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>misc/**</exclude>
-          </excludes>
-          <!-- put your configurations here -->
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/src/Makefile.am b/src/Makefile.am
index c59edb5..5bc8caf 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 Simon Josefsson
+# Copyright (C) 2002-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/src/idn.c b/src/idn.c
index b09762e..89d6da1 100644
--- a/src/idn.c
+++ b/src/idn.c
@@ -1,5 +1,5 @@
 /* idn.c --- Command line interface to libidn.
- * Copyright (C) 2003-2012 Simon Josefsson
+ * Copyright (C) 2003-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
@@ -48,7 +48,7 @@
 #include "idn_cmd.h"
 
 #define GREETING \
-  "Copyright 2002-2012 Simon Josefsson.\n"                              \
+  "Copyright 2002-2013 Simon Josefsson.\n"                              \
   "GNU Libidn is free software with ABSOLUTELY NO WARRANTY.  For more\n" \
   "information about these matters, see <http://www.gnu.org/licenses/>.\n"
 
diff --git a/src/idn.ggo b/src/idn.ggo
index 025541c..78ed0b3 100644
--- a/src/idn.ggo
+++ b/src/idn.ggo
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2012 Simon Josefsson.
+# Copyright (C) 2003-2013 Simon Josefsson.
 #
 # This file is part of GNU Libidn.
 #
diff --git a/src/idna.el b/src/idna.el
index 2f539d6..8e4d868 100644
--- a/src/idna.el
+++ b/src/idna.el
@@ -1,6 +1,6 @@
 ;;; idna.el --- Internationalizing Domain Names in Applications.
 
-;; Copyright (C) 2003-2012 Simon Josefsson
+;; Copyright (C) 2003-2013 Simon Josefsson
 ;; Keywords: idna, idn, domain name, internationalization
 
 ;; This file is part of GNU Libidn.
diff --git a/src/punycode.el b/src/punycode.el
index 32f81b4..14ac0d5 100644
--- a/src/punycode.el
+++ b/src/punycode.el
@@ -1,6 +1,6 @@
 ;;; punycode.el --- An ASCII compatible Unicode encoding format.
 
-;; Copyright (C) 2003-2012 Simon Josefsson
+;; Copyright (C) 2003-2013 Simon Josefsson
 ;; Keywords: punycode, idna, idn, unicode, encoding
 
 ;; This file is part of GNU Libidn.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f84e069..a372203 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 Simon Josefsson
+# Copyright (C) 2002-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/tests/libidn.supp b/tests/libidn.supp
index 7da3445..44acbb4 100644
--- a/tests/libidn.supp
+++ b/tests/libidn.supp
@@ -1,5 +1,5 @@
 # libidn.supp -- Valgrind suppression file for Libidn
-# Copyright (C) 2012 Simon Josefsson
+# Copyright (C) 2012-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #
diff --git a/tests/tst_idna.c b/tests/tst_idna.c
index 8c4ab78..5af1a9a 100644
--- a/tests/tst_idna.c
+++ b/tests/tst_idna.c
@@ -1,5 +1,5 @@
 /* tst_idna.c --- Self tests for idna_to_ascii().
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c
index 4528d17..39a34dc 100644
--- a/tests/tst_idna2.c
+++ b/tests/tst_idna2.c
@@ -1,5 +1,5 @@
 /* tst_idna2.c --- Self tests for idna_to_ascii_8z().
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c
index acf03cb..655ae08 100644
--- a/tests/tst_idna3.c
+++ b/tests/tst_idna3.c
@@ -1,5 +1,5 @@
 /* tst_idna3.c --- Self tests for upper-case XN-- regression.
- * Copyright (C) 2011-2012 Simon Josefsson
+ * Copyright (C) 2011-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_idna4.c b/tests/tst_idna4.c
index cfccee4..ee11388 100644
--- a/tests/tst_idna4.c
+++ b/tests/tst_idna4.c
@@ -1,5 +1,5 @@
 /* tst_idna4.c --- Self tests for memory leak regression.
- * Copyright (C) 2011-2012 Simon Josefsson
+ * Copyright (C) 2011-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c
index 86884d7..306215b 100644
--- a/tests/tst_nfkc.c
+++ b/tests/tst_nfkc.c
@@ -1,5 +1,5 @@
 /* tst_nfkc.c --- Self tests for stringprep_utf8_nfkc_normalize().
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c
index 4668c02..096a21e 100644
--- a/tests/tst_pr29.c
+++ b/tests/tst_pr29.c
@@ -1,5 +1,5 @@
 /* tst_pr29.c --- Self tests for pr29_*().
- * Copyright (C) 2004-2012 Simon Josefsson
+ * Copyright (C) 2004-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c
index 61a983a..611781d 100644
--- a/tests/tst_punycode.c
+++ b/tests/tst_punycode.c
@@ -1,5 +1,5 @@
 /* tst_punycode.c --- Self tests for punycode.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c
index 87e2dcf..51124e3 100644
--- a/tests/tst_strerror.c
+++ b/tests/tst_strerror.c
@@ -1,5 +1,5 @@
 /* tst_strerror.c --- Self tests for *_strerror().
- * Copyright (C) 2004-2012 Simon Josefsson
+ * Copyright (C) 2004-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c
index 499bd2d..4f81a21 100644
--- a/tests/tst_stringprep.c
+++ b/tests/tst_stringprep.c
@@ -1,5 +1,5 @@
 /* tst_stringprep.c --- Self tests for stringprep().
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_symbols.c b/tests/tst_symbols.c
index 86d4f84..faf3e0d 100644
--- a/tests/tst_symbols.c
+++ b/tests/tst_symbols.c
@@ -1,5 +1,5 @@
 /* tst_symbols.c --- Test if all exported symbols are available.
- * Copyright (C) 2010-2012 Simon Josefsson
+ * Copyright (C) 2010-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_tld.c b/tests/tst_tld.c
index d70ab14..5490e41 100644
--- a/tests/tst_tld.c
+++ b/tests/tst_tld.c
@@ -1,5 +1,5 @@
 /* tst_tld.c --- Self tests for tld_*().
- * Copyright (C) 2004-2012 Simon Josefsson
+ * Copyright (C) 2004-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/tst_toutf8.c b/tests/tst_toutf8.c
index a98f012..6256af7 100644
--- a/tests/tst_toutf8.c
+++ b/tests/tst_toutf8.c
@@ -1,5 +1,5 @@
 /* tst_toutf8.c --- Self tests for UTF-8 conversion functions.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/utils.c b/tests/utils.c
index 15e4049..828b023 100644
--- a/tests/utils.c
+++ b/tests/utils.c
@@ -1,5 +1,5 @@
 /* utils.c --- Self test utilities.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/tests/utils.h b/tests/utils.h
index 8709e79..4a12b8f 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -1,5 +1,5 @@
 /* utils.h --- Prototypes for self test utilities.
- * Copyright (C) 2002-2012 Simon Josefsson
+ * Copyright (C) 2002-2013 Simon Josefsson
  *
  * This file is part of GNU Libidn.
  *
diff --git a/windows/include/ac-stdint.h b/windows/include/ac-stdint.h
index e5be451..c0601f9 100644
--- a/windows/include/ac-stdint.h
+++ b/windows/include/ac-stdint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2013 Free Software Foundation, Inc.
    Written by Adam Strzelecki <address@hidden>
 
    This file is part of GNU Libidn.
diff --git a/windows/include/config.h b/windows/include/config.h
index 90409a4..80173a0 100644
--- a/windows/include/config.h
+++ b/windows/include/config.h
@@ -1,5 +1,5 @@
 /* config.h --- System definitions for Windows
-   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2013 Free Software Foundation, Inc.
 
    This file is part of GNU Libidn.
 
diff --git a/windows/include/idn-int.h b/windows/include/idn-int.h
index ca86658..b5ef9ad 100644
--- a/windows/include/idn-int.h
+++ b/windows/include/idn-int.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2013 Free Software Foundation, Inc.
    Written by Adam Strzelecki <address@hidden>
 
    This file is part of GNU Libidn.
diff --git a/windows/include/stdbool.h b/windows/include/stdbool.h
index 2a1eb8f..13dfc52 100644
--- a/windows/include/stdbool.h
+++ b/windows/include/stdbool.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2013 Free Software Foundation, Inc.
    Written by Adam Strzelecki <address@hidden>
 
    This file is part of GNU Libidn.
diff --git a/windows/libidn4win.mk b/windows/libidn4win.mk
index 24f41f0..3b7d9ab 100644
--- a/windows/libidn4win.mk
+++ b/windows/libidn4win.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2012 Simon Josefsson
+# Copyright (C) 2011-2013 Simon Josefsson
 #
 # This file is part of GNU Libidn.
 #


hooks/post-receive
-- 
GNU libidn



reply via email to

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