]> sjero.net Git - wget/commitdiff
Merge getpass with quote, plus my NEWS entry.
authorMicah Cowan <micah@cowan.name>
Fri, 16 May 2008 03:58:27 +0000 (20:58 -0700)
committerMicah Cowan <micah@cowan.name>
Fri, 16 May 2008 03:58:27 +0000 (20:58 -0700)
24 files changed:
1  2 
ChangeLog
NEWS
doc/ChangeLog
doc/wget.texi
lib/Makefile.am
lib/stdlib.in.h
lib/string.in.h
lib/wctype.in.h
lib/xalloc.h
lib/xmalloc.c
m4/extensions.m4
m4/getopt.m4
m4/gnulib-cache.m4
m4/gnulib-common.m4
m4/gnulib-comp.m4
m4/mbstate_t.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strerror.m4
m4/string_h.m4
m4/wctype.m4
src/ChangeLog
src/init.c
src/main.c

diff --cc ChangeLog
index a0a295d85ad6e83cd7811af2fc7b8c59db20eb78,89fbb4ec1ef9b7b932343fa532bca35b16b55ce7..697f2ca6da2f469ccdc5b85e5731f946ec12da33
+++ b/ChangeLog
@@@ -1,29 -1,24 +1,54 @@@
++2008-05-15  Micah Cowan  <micah@cowan.name>
++
++      * NEWS: Entry for --ask-password.
++
 +2008-05-12  Micah Cowan  <micah@cowan.name>
 +
 +      * NEWS: Translations and -N/-O.
 +
 +2008-04-30  Micah Cowan  <micah@cowan.name>
 +
 +      * NEWS: Added documentation for changes made in 1.11.2.
 +
+ 2008-04-30  Steven Schubiger  <stsc@members.fsf.org>
+       * lib/getdelim.c, lib/getline.c, lib/getpass.c,
+       lib/getpass.h, lib/realloc.c, lib/stdio.h,
+       lib/stdio.in.h, lib/stdlib.h, lib/stdlib.in.h: Imported 
+       from gnulib.
+       * m4/eoverflow.m4, m4/extensions.m4, m4/getdelim.m4, 
+       m4/getline.m4, m4/getpass.m4, m4/malloc.m4, m4/realloc.m4, 
+       m4/stdio_h.m4, m4/stdlib_h.m4: Imported from gnulib.
+       * md5/stdint.h: Imported from gnulib.
+       
+       * GNUmakefile: Updated from gnulib.
+       * lib/Makefile.am, lib/getopt.c, lib/unistd.in.h: Updated
+       from gnulib.
+       * m4/gnulib-cache.m4, m4/gnulib-common.m4, m4/gnulib-comp.m4,
+       m4/include_next.m4, m4/unistd_h.m4: Updated from gnulib.
+       * md5/Makefile.am, md5/m4/gnulib-cache.m4, md5/m4/gnulib-common.m4,
+       md5/m4/gnulib-comp.m4, md5/m4/include_next.m4, md5/m4/md5.m4,
+       md5/m4/stdint.m4, md5/md5.c, md5/md5.h, md5/stdint.in.h,
+       md5/wchar.in.h: Updated from gnulib.
+  
 +2008-04-14  Micah Cowan  <micah@cowan.name>
 +
 +      * GNUmakefile, lib/Makefile.am, lib/error.c, lib/error.h,
 +      lib/exitfail.c, lib/exitfail.h, lib/getopt.c, lib/intprops.h,
 +      lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
 +      lib/stdlib.in.h, lib/strerror.c, lib/string.in.h,
 +      lib/unistd.in.h, lib/wchar.in.h, lib/wctype.in.h,
 +      lib/xalloc-die.c, lib/xalloc.h, lib/xmalloc.c, m4/error.m4,
 +      m4/exitfail.m4, m4/extensions.m4, m4/gnulib-cache.m4,
 +      m4/gnulib-comp.m4, m4/include_next.m4, m4/inline.m4,
 +      m4/mbrtowc.m4, m4/mbstate_t.m4, m4/quote.m4, m4/quotearg.m4,
 +      m4/stdlib_h.m4, m4/strerror.m4, m4/string_h.m4, m4/unistd_h.m4,
 +      m4/wchar.m4, m4/wctype.m4, m4/wint_t.m4, m4/xalloc.m4,
 +      md5/Makefile.am, md5/m4/gnulib-cache.m4, md5/m4/gnulib-comp.m4,
 +      md5/m4/include_next.m4, md5/m4/md5.m4, md5/m4/stdint.m4,
 +      md5/md5.c, md5/md5.h, md5/stdint.in.h, md5/wchar.in.h: Update
 +      from Gnulib, and add the "quote" module.
 +
  2008-03-20  Micah Cowan  <micah@cowan.name>
  
        * ABOUT-NLS: Reinstated, but with a message mentioning that
diff --cc NEWS
index 24a097c482bf6e7be6fdf7325b104411a9c5d145,e57acec35ffdcb66b6fd103b0fdd056ed1885855..e74ce2a0ae1a9c74ecc539ec283386eff270aea9
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -5,34 -5,15 +5,40 @@@ Copyright (C) 1997, 1998, 1999, 2000, 2
  See the end for copying conditions.
  
  Please send GNU Wget bug reports to <bug-wget@gnu.org>.
 -* Changes in Wget (MAINLINE).
\f
 -** Gnulib's getpass-gnu module is used to prompt for passwords.
++* Changes in Wget 1.12 (MAINLINE)
 -** Gnulib is now used to provide code for certain portability aspects in
 -GNU Wget.
++** --ask-password option (and associated wgetrc command) added to
++support password prompts at the console.
 +\f
 +* Changes in Wget 1.11.3
 +
 +** Downgraded -N with -O to a warning, rather than an error.
 +
 +** Translation updates
 +\f
 +* Changes in Wget 1.11.2
 +
 +** Fixed a problem in authenticating over HTTPS through a proxy.
 +(Regression in 1.11 over 1.10.2.)
 +
 +** The combination of -r or -p with -O, which was disallowed in 1.11,
 +has been downgraded to a warning in 1.11.2. (-O and -N, which was never
 +meaningful, is still an error.)
 +
 +** Further improvements to progress bar displays in non-English locales
 +(too many spaces could be inserted, causing the display to scroll).
 +
 +** Successive invocations of Wget on FTP URLS, with --no-remove-listing
 +and --continue, was causing Wget to append, rather than replace,
 +information in the .listing file, and thereby download the same files
 +multiple times. This has been fixed in 1.11.2.
  
 -** Wget uses Automake now as part of its build infrastructure.
 +** Wget 1.11 no longer allowed ".." to persist at the beginning of URLs,
 +for improved conformance with RFC 3986. However, this behavior presents
 +problems for some FTP setups, and so they are now preserved again, for
 +FTP URLs only.
  \f
  * Changes in Wget 1.11.1.
  
diff --cc doc/ChangeLog
index 44c5cd89cd828fa20460aa2e4df42565f29aa76e,97a0be5514a0a8dd7a9495f36ad65543bfcbb084..94b230c0b298d8315c538e4b403b6039368e67be
@@@ -1,8 -1,8 +1,13 @@@
 +2008-05-12  Micah Cowan  <micah@cowan.name>
 +
 +      * wget.texi (Download Options): -N with -O downgraded to a
 +      warning.
 +
+ 2008-04-30  Steven Schubiger  <stsc@members.fsf.org>
+       * wget.texi <Download Options>: Document the --ask-password
+       option.
  2008-04-27  Micah Cowan  <micah@cowan.name>
  
        * wget.texi (Download Options) <-O>: Elaborate on why certain
diff --cc doc/wget.texi
Simple merge
diff --cc lib/Makefile.am
index 4e1c27679745cff6707ef6b3a755f3b26ff544b8,7d99d56244f009972ca8b6c992ccc300a7e685a1..796a645adac09c37793bff56d8837863a114088c
@@@ -9,7 -9,7 +9,7 @@@
  # the same distribution terms as the rest of that program.
  #
  # Generated by gnulib-tool.
- # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl alloca c-ctype getopt maintainer-makefile quote
 -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl c-ctype getopt getpass-gnu maintainer-makefile
++# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl alloca c-ctype getopt getpass-gnu maintainer-makefile quote
  
  AUTOMAKE_OPTIONS = 1.5 gnits
  
@@@ -68,24 -40,24 +68,42 @@@ libgnu_a_SOURCES += c-ctype.h c-ctype.
  
  ## end   gnulib module c-ctype
  
 +## begin gnulib module error
 +
 +
 +EXTRA_DIST += error.c error.h
 +
 +EXTRA_libgnu_a_SOURCES += error.c
 +
 +## end   gnulib module error
 +
 +## begin gnulib module exitfail
 +
 +
 +EXTRA_DIST += exitfail.c exitfail.h
 +
 +EXTRA_libgnu_a_SOURCES += exitfail.c
 +
 +## end   gnulib module exitfail
 +
+ ## begin gnulib module getdelim
+ EXTRA_DIST += getdelim.c
+ EXTRA_libgnu_a_SOURCES += getdelim.c
+ ## end   gnulib module getdelim
+ ## begin gnulib module getline
+ EXTRA_DIST += getline.c
+ EXTRA_libgnu_a_SOURCES += getline.c
+ ## end   gnulib module getline
  ## begin gnulib module getopt
  
  BUILT_SOURCES += $(GETOPT_H)
@@@ -142,24 -116,15 +169,33 @@@ EXTRA_DIST += $(top_srcdir)/maint.m
  
  ## end   gnulib module maintainer-makefile
  
 +## begin gnulib module quote
 +
 +
 +EXTRA_DIST += quote.c quote.h
 +
 +EXTRA_libgnu_a_SOURCES += quote.c
 +
 +## end   gnulib module quote
 +
 +## begin gnulib module quotearg
 +
 +
 +EXTRA_DIST += quotearg.c quotearg.h
 +
 +EXTRA_libgnu_a_SOURCES += quotearg.c
 +
 +## end   gnulib module quotearg
 +
+ ## begin gnulib module realloc-posix
+ EXTRA_DIST += realloc.c
+ EXTRA_libgnu_a_SOURCES += realloc.c
+ ## end   gnulib module realloc-posix
  ## begin gnulib module stdbool
  
  BUILT_SOURCES += $(STDBOOL_H)
@@@ -196,6 -222,6 +293,7 @@@ stdlib.h: stdlib.in.
              -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
              -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
              -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
++            -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
              -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
              -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
              -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
++            -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
              -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
@@@ -221,87 -247,6 +320,89 @@@ EXTRA_DIST += stdlib.in.
  
  ## end   gnulib module stdlib
  
 +## begin gnulib module strerror
 +
 +
 +EXTRA_DIST += strerror.c
 +
 +EXTRA_libgnu_a_SOURCES += strerror.c
 +
 +## end   gnulib module strerror
 +
 +## begin gnulib module string
 +
 +BUILT_SOURCES += string.h
 +
 +# We need the following in order to create <string.h> when the system
 +# doesn't have one that works with the given compiler.
 +string.h: string.in.h
 +      rm -f $@-t $@
 +      { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 +        sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
 +            -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
 +            -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
 +            -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
 +            -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
 +            -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
 +            -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
 +            -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
 +            -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
 +            -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
 +            -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
 +            -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
 +            -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
 +            -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
 +            -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
 +            -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
 +            -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
 +            -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
 +            -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
++            -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
 +            -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
 +            -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
 +            -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
 +            -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
 +            -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
 +            -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
 +            -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
 +            -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
 +            -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
 +            -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
 +            -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
 +            -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
 +            -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
 +            -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
 +            -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
 +            -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
++            -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
 +            -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
 +            -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
 +            -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
 +            -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
 +            -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
 +            -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
 +            -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
 +            -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
 +            -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
 +            -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
 +            -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
 +            -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
 +            -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
 +            -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
 +            -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
 +            -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
 +            -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
 +            -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
 +            -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 +            < $(srcdir)/string.in.h; \
 +      } > $@-t
 +      mv $@-t $@
 +MOSTLYCLEANFILES += string.h string.h-t
 +
 +EXTRA_DIST += string.in.h
 +
 +## end   gnulib module string
 +
  ## begin gnulib module unistd
  
  BUILT_SOURCES += unistd.h
@@@ -350,69 -295,6 +451,70 @@@ EXTRA_DIST += unistd.in.
  
  ## end   gnulib module unistd
  
 +## begin gnulib module wchar
 +
 +BUILT_SOURCES += $(WCHAR_H)
 +
 +# We need the following in order to create <wchar.h> when the system
 +# version does not work standalone.
 +wchar.h: wchar.in.h
 +      rm -f $@-t $@
 +      { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
 +        sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
 +            -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
 +            -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
 +            -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
 +            -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
 +            -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
 +            -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 +          < $(srcdir)/wchar.in.h; \
 +      } > $@-t
 +      mv $@-t $@
 +MOSTLYCLEANFILES += wchar.h wchar.h-t
 +
 +EXTRA_DIST += wchar.in.h
 +
 +## end   gnulib module wchar
 +
 +## begin gnulib module wctype
 +
 +BUILT_SOURCES += $(WCTYPE_H)
 +
 +# We need the following in order to create <wctype.h> when the system
 +# doesn't have one that works with the given compiler.
 +wctype.h: wctype.in.h
 +      rm -f $@-t $@
 +      { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
 +        sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
 +            -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
 +            -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
 +            -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
 +            -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
++            -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
 +            < $(srcdir)/wctype.in.h; \
 +      } > $@-t
 +      mv $@-t $@
 +MOSTLYCLEANFILES += wctype.h wctype.h-t
 +
 +EXTRA_DIST += wctype.in.h
 +
 +## end   gnulib module wctype
 +
 +## begin gnulib module xalloc
 +
 +
 +EXTRA_DIST += xalloc.h xmalloc.c
 +
 +EXTRA_libgnu_a_SOURCES += xmalloc.c
 +
 +## end   gnulib module xalloc
 +
 +## begin gnulib module xalloc-die
 +
 +libgnu_a_SOURCES += xalloc-die.c
 +
 +## end   gnulib module xalloc-die
 +
  
  mostlyclean-local: mostlyclean-generic
        @for dir in '' $(MOSTLYCLEANDIRS); do \
diff --cc lib/stdlib.in.h
index 0181dd23762a5f3b7da59995ae9e603e36b635f2,0181dd23762a5f3b7da59995ae9e603e36b635f2..b0fb12fcbc9fbcb9d86e18c24a8a22172c916281
@@@ -176,6 -176,6 +176,21 @@@ extern int putenv (char *string)
  #endif
  
  
++#if @GNULIB_RPMATCH@
++# if !@HAVE_RPMATCH@
++/* Test a user response to a question.
++   Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
++extern int rpmatch (const char *response);
++# endif
++#elif defined GNULIB_POSIXCHECK
++# undef rpmatch
++# define rpmatch(r) \
++    (GL_LINK_WARNING ("rpmatch is unportable - " \
++                      "use gnulib module rpmatch for portability"), \
++     rpmatch (r))
++#endif
++
++
  #if @GNULIB_SETENV@
  # if !@HAVE_SETENV@
  /* Set NAME to VALUE in the environment.
diff --cc lib/string.in.h
index 5c7597cefb1e41b69c21723e001736e19fbe8933,0000000000000000000000000000000000000000..41e765cc2bb3bbd2d1572f84c7e1523796af299a
mode 100644,000000..100644
--- /dev/null
@@@ -1,569 -1,0 +1,585 @@@
 +/* A GNU-like <string.h>.
 +
 +   Copyright (C) 1995-1996, 2001-2008 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
 +   the Free Software Foundation; either version 3, 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, write to the Free Software Foundation,
 +   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 +
 +#ifndef _GL_STRING_H
 +
 +/* The include_next requires a split double-inclusion guard.  */
 +#@INCLUDE_NEXT@ @NEXT_STRING_H@
 +
 +#ifndef _GL_STRING_H
 +#define _GL_STRING_H
 +
 +
 +#ifndef __attribute__
 +/* This feature is available in gcc versions 2.5 and later.  */
 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
 +#  define __attribute__(Spec) /* empty */
 +# endif
 +/* The attribute __pure__ was added in gcc 2.96.  */
 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
 +#  define __pure__ /* empty */
 +# endif
 +#endif
 +
 +
 +/* The definition of GL_LINK_WARNING is copied here.  */
 +
 +
 +#ifdef __cplusplus
 +extern "C" {
 +#endif
 +
 +
 +/* Return the first occurrence of NEEDLE in HAYSTACK.  */
 +#if @GNULIB_MEMMEM@
 +# if @REPLACE_MEMMEM@
 +#  define memmem rpl_memmem
 +# endif
 +# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
 +extern void *memmem (void const *__haystack, size_t __haystack_len,
 +                   void const *__needle, size_t __needle_len)
 +  __attribute__ ((__pure__));
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef memmem
 +# define memmem(a,al,b,bl) \
 +    (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \
 +                      "use gnulib module memmem-simple for portability, " \
 +                      "and module memmem for speed" ), \
 +     memmem (a, al, b, bl))
 +#endif
 +
 +/* Copy N bytes of SRC to DEST, return pointer to bytes after the
 +   last written byte.  */
 +#if @GNULIB_MEMPCPY@
 +# if ! @HAVE_MEMPCPY@
 +extern void *mempcpy (void *restrict __dest, void const *restrict __src,
 +                    size_t __n);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef mempcpy
 +# define mempcpy(a,b,n) \
 +    (GL_LINK_WARNING ("mempcpy is unportable - " \
 +                      "use gnulib module mempcpy for portability"), \
 +     mempcpy (a, b, n))
 +#endif
 +
 +/* Search backwards through a block for a byte (specified as an int).  */
 +#if @GNULIB_MEMRCHR@
 +# if ! @HAVE_DECL_MEMRCHR@
 +extern void *memrchr (void const *, int, size_t)
 +  __attribute__ ((__pure__));
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef memrchr
 +# define memrchr(a,b,c) \
 +    (GL_LINK_WARNING ("memrchr is unportable - " \
 +                      "use gnulib module memrchr for portability"), \
 +     memrchr (a, b, c))
 +#endif
 +
++/* Find the first occurrence of C in S.  More efficient than
++   memchr(S,C,N), at the expense of undefined behavior if C does not
++   occur within N bytes.  */
++#if @GNULIB_RAWMEMCHR@
++# if ! @HAVE_RAWMEMCHR@
++extern void *rawmemchr (void const *__s, int __c_in)
++  __attribute__ ((__pure__));
++# endif
++#elif defined GNULIB_POSIXCHECK
++# undef rawmemchr
++# define rawmemchr(a,b) \
++    (GL_LINK_WARNING ("rawmemchr is unportable - " \
++                      "use gnulib module rawmemchr for portability"), \
++     rawmemchr (a, b))
++#endif
++
 +/* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
 +#if @GNULIB_STPCPY@
 +# if ! @HAVE_STPCPY@
 +extern char *stpcpy (char *restrict __dst, char const *restrict __src);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef stpcpy
 +# define stpcpy(a,b) \
 +    (GL_LINK_WARNING ("stpcpy is unportable - " \
 +                      "use gnulib module stpcpy for portability"), \
 +     stpcpy (a, b))
 +#endif
 +
 +/* Copy no more than N bytes of SRC to DST, returning a pointer past the
 +   last non-NUL byte written into DST.  */
 +#if @GNULIB_STPNCPY@
 +# if ! @HAVE_STPNCPY@
 +#  define stpncpy gnu_stpncpy
 +extern char *stpncpy (char *restrict __dst, char const *restrict __src,
 +                    size_t __n);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef stpncpy
 +# define stpncpy(a,b,n) \
 +    (GL_LINK_WARNING ("stpncpy is unportable - " \
 +                      "use gnulib module stpncpy for portability"), \
 +     stpncpy (a, b, n))
 +#endif
 +
 +#if defined GNULIB_POSIXCHECK
 +/* strchr() does not work with multibyte strings if the locale encoding is
 +   GB18030 and the character to be searched is a digit.  */
 +# undef strchr
 +# define strchr(s,c) \
 +    (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \
 +                      "in some multibyte locales - " \
 +                      "use mbschr if you care about internationalization"), \
 +     strchr (s, c))
 +#endif
 +
 +/* Find the first occurrence of C in S or the final NUL byte.  */
 +#if @GNULIB_STRCHRNUL@
 +# if ! @HAVE_STRCHRNUL@
 +extern char *strchrnul (char const *__s, int __c_in)
 +  __attribute__ ((__pure__));
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strchrnul
 +# define strchrnul(a,b) \
 +    (GL_LINK_WARNING ("strchrnul is unportable - " \
 +                      "use gnulib module strchrnul for portability"), \
 +     strchrnul (a, b))
 +#endif
 +
 +/* Duplicate S, returning an identical malloc'd string.  */
 +#if @GNULIB_STRDUP@
 +# if ! @HAVE_DECL_STRDUP@ && ! defined strdup
 +extern char *strdup (char const *__s);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strdup
 +# define strdup(a) \
 +    (GL_LINK_WARNING ("strdup is unportable - " \
 +                      "use gnulib module strdup for portability"), \
 +     strdup (a))
 +#endif
 +
 +/* Return a newly allocated copy of at most N bytes of STRING.  */
 +#if @GNULIB_STRNDUP@
 +# if ! @HAVE_STRNDUP@
 +#  undef strndup
 +#  define strndup rpl_strndup
 +# endif
 +# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
 +extern char *strndup (char const *__string, size_t __n);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strndup
 +# define strndup(a,n) \
 +    (GL_LINK_WARNING ("strndup is unportable - " \
 +                      "use gnulib module strndup for portability"), \
 +     strndup (a, n))
 +#endif
 +
 +/* Find the length (number of bytes) of STRING, but scan at most
 +   MAXLEN bytes.  If no '\0' terminator is found in that many bytes,
 +   return MAXLEN.  */
 +#if @GNULIB_STRNLEN@
 +# if ! @HAVE_DECL_STRNLEN@
 +extern size_t strnlen (char const *__string, size_t __maxlen)
 +  __attribute__ ((__pure__));
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strnlen
 +# define strnlen(a,n) \
 +    (GL_LINK_WARNING ("strnlen is unportable - " \
 +                      "use gnulib module strnlen for portability"), \
 +     strnlen (a, n))
 +#endif
 +
 +#if defined GNULIB_POSIXCHECK
 +/* strcspn() assumes the second argument is a list of single-byte characters.
 +   Even in this simple case, it does not work with multibyte strings if the
 +   locale encoding is GB18030 and one of the characters to be searched is a
 +   digit.  */
 +# undef strcspn
 +# define strcspn(s,a) \
 +    (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \
 +                      "in multibyte locales - " \
 +                      "use mbscspn if you care about internationalization"), \
 +     strcspn (s, a))
 +#endif
 +
 +/* Find the first occurrence in S of any character in ACCEPT.  */
 +#if @GNULIB_STRPBRK@
 +# if ! @HAVE_STRPBRK@
 +extern char *strpbrk (char const *__s, char const *__accept)
 +  __attribute__ ((__pure__));
 +# endif
 +# if defined GNULIB_POSIXCHECK
 +/* strpbrk() assumes the second argument is a list of single-byte characters.
 +   Even in this simple case, it does not work with multibyte strings if the
 +   locale encoding is GB18030 and one of the characters to be searched is a
 +   digit.  */
 +#  undef strpbrk
 +#  define strpbrk(s,a) \
 +     (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \
 +                       "in multibyte locales - " \
 +                       "use mbspbrk if you care about internationalization"), \
 +      strpbrk (s, a))
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strpbrk
 +# define strpbrk(s,a) \
 +    (GL_LINK_WARNING ("strpbrk is unportable - " \
 +                      "use gnulib module strpbrk for portability"), \
 +     strpbrk (s, a))
 +#endif
 +
 +#if defined GNULIB_POSIXCHECK
 +/* strspn() assumes the second argument is a list of single-byte characters.
 +   Even in this simple case, it cannot work with multibyte strings.  */
 +# undef strspn
 +# define strspn(s,a) \
 +    (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \
 +                      "in multibyte locales - " \
 +                      "use mbsspn if you care about internationalization"), \
 +     strspn (s, a))
 +#endif
 +
 +#if defined GNULIB_POSIXCHECK
 +/* strrchr() does not work with multibyte strings if the locale encoding is
 +   GB18030 and the character to be searched is a digit.  */
 +# undef strrchr
 +# define strrchr(s,c) \
 +    (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \
 +                      "in some multibyte locales - " \
 +                      "use mbsrchr if you care about internationalization"), \
 +     strrchr (s, c))
 +#endif
 +
 +/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
 +   If one is found, overwrite it with a NUL, and advance *STRINGP
 +   to point to the next char after it.  Otherwise, set *STRINGP to NULL.
 +   If *STRINGP was already NULL, nothing happens.
 +   Return the old value of *STRINGP.
 +
 +   This is a variant of strtok() that is multithread-safe and supports
 +   empty fields.
 +
 +   Caveat: It modifies the original string.
 +   Caveat: These functions cannot be used on constant strings.
 +   Caveat: The identity of the delimiting character is lost.
 +   Caveat: It doesn't work with multibyte strings unless all of the delimiter
 +           characters are ASCII characters < 0x30.
 +
 +   See also strtok_r().  */
 +#if @GNULIB_STRSEP@
 +# if ! @HAVE_STRSEP@
 +extern char *strsep (char **restrict __stringp, char const *restrict __delim);
 +# endif
 +# if defined GNULIB_POSIXCHECK
 +#  undef strsep
 +#  define strsep(s,d) \
 +     (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \
 +                       "in multibyte locales - " \
 +                       "use mbssep if you care about internationalization"), \
 +      strsep (s, d))
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strsep
 +# define strsep(s,d) \
 +    (GL_LINK_WARNING ("strsep is unportable - " \
 +                      "use gnulib module strsep for portability"), \
 +     strsep (s, d))
 +#endif
 +
 +#if @GNULIB_STRSTR@
 +# if @REPLACE_STRSTR@
 +#  define strstr rpl_strstr
 +char *strstr (const char *haystack, const char *needle)
 +  __attribute__ ((__pure__));
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +/* strstr() does not work with multibyte strings if the locale encoding is
 +   different from UTF-8:
 +   POSIX says that it operates on "strings", and "string" in POSIX is defined
 +   as a sequence of bytes, not of characters.  */
 +# undef strstr
 +# define strstr(a,b) \
 +    (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \
 +                      "work correctly on character strings in most "    \
 +                      "multibyte locales - " \
 +                      "use mbsstr if you care about internationalization, " \
 +                      "or use strstr if you care about speed"), \
 +     strstr (a, b))
 +#endif
 +
 +/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
 +   comparison.  */
 +#if @GNULIB_STRCASESTR@
 +# if @REPLACE_STRCASESTR@
 +#  define strcasestr rpl_strcasestr
 +# endif
 +# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
 +extern char *strcasestr (const char *haystack, const char *needle)
 +  __attribute__ ((__pure__));
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +/* strcasestr() does not work with multibyte strings:
 +   It is a glibc extension, and glibc implements it only for unibyte
 +   locales.  */
 +# undef strcasestr
 +# define strcasestr(a,b) \
 +    (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \
 +                      "in multibyte locales - " \
 +                      "use mbscasestr if you care about " \
 +                      "internationalization, or use c-strcasestr if you want " \
 +                      "a locale independent function"), \
 +     strcasestr (a, b))
 +#endif
 +
 +/* Parse S into tokens separated by characters in DELIM.
 +   If S is NULL, the saved pointer in SAVE_PTR is used as
 +   the next starting point.  For example:
 +      char s[] = "-abc-=-def";
 +      char *sp;
 +      x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
 +      x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
 +      x = strtok_r(NULL, "=", &sp);   // x = NULL
 +              // s = "abc\0-def\0"
 +
 +   This is a variant of strtok() that is multithread-safe.
 +
 +   For the POSIX documentation for this function, see:
 +   http://www.opengroup.org/susv3xsh/strtok.html
 +
 +   Caveat: It modifies the original string.
 +   Caveat: These functions cannot be used on constant strings.
 +   Caveat: The identity of the delimiting character is lost.
 +   Caveat: It doesn't work with multibyte strings unless all of the delimiter
 +           characters are ASCII characters < 0x30.
 +
 +   See also strsep().  */
 +#if @GNULIB_STRTOK_R@
 +# if ! @HAVE_DECL_STRTOK_R@
 +extern char *strtok_r (char *restrict s, char const *restrict delim,
 +                     char **restrict save_ptr);
 +# endif
 +# if defined GNULIB_POSIXCHECK
 +#  undef strtok_r
 +#  define strtok_r(s,d,p) \
 +     (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \
 +                       "in multibyte locales - " \
 +                       "use mbstok_r if you care about internationalization"), \
 +      strtok_r (s, d, p))
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strtok_r
 +# define strtok_r(s,d,p) \
 +    (GL_LINK_WARNING ("strtok_r is unportable - " \
 +                      "use gnulib module strtok_r for portability"), \
 +     strtok_r (s, d, p))
 +#endif
 +
 +
 +/* The following functions are not specified by POSIX.  They are gnulib
 +   extensions.  */
 +
 +#if @GNULIB_MBSLEN@
 +/* Return the number of multibyte characters in the character string STRING.
 +   This considers multibyte characters, unlike strlen, which counts bytes.  */
 +extern size_t mbslen (const char *string);
 +#endif
 +
 +#if @GNULIB_MBSNLEN@
 +/* Return the number of multibyte characters in the character string starting
 +   at STRING and ending at STRING + LEN.  */
 +extern size_t mbsnlen (const char *string, size_t len);
 +#endif
 +
 +#if @GNULIB_MBSCHR@
 +/* Locate the first single-byte character C in the character string STRING,
 +   and return a pointer to it.  Return NULL if C is not found in STRING.
 +   Unlike strchr(), this function works correctly in multibyte locales with
 +   encodings such as GB18030.  */
 +# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
 +extern char * mbschr (const char *string, int c);
 +#endif
 +
 +#if @GNULIB_MBSRCHR@
 +/* Locate the last single-byte character C in the character string STRING,
 +   and return a pointer to it.  Return NULL if C is not found in STRING.
 +   Unlike strrchr(), this function works correctly in multibyte locales with
 +   encodings such as GB18030.  */
 +# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
 +extern char * mbsrchr (const char *string, int c);
 +#endif
 +
 +#if @GNULIB_MBSSTR@
 +/* Find the first occurrence of the character string NEEDLE in the character
 +   string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
 +   Unlike strstr(), this function works correctly in multibyte locales with
 +   encodings different from UTF-8.  */
 +extern char * mbsstr (const char *haystack, const char *needle);
 +#endif
 +
 +#if @GNULIB_MBSCASECMP@
 +/* Compare the character strings S1 and S2, ignoring case, returning less than,
 +   equal to or greater than zero if S1 is lexicographically less than, equal to
 +   or greater than S2.
 +   Note: This function may, in multibyte locales, return 0 for strings of
 +   different lengths!
 +   Unlike strcasecmp(), this function works correctly in multibyte locales.  */
 +extern int mbscasecmp (const char *s1, const char *s2);
 +#endif
 +
 +#if @GNULIB_MBSNCASECMP@
 +/* Compare the initial segment of the character string S1 consisting of at most
 +   N characters with the initial segment of the character string S2 consisting
 +   of at most N characters, ignoring case, returning less than, equal to or
 +   greater than zero if the initial segment of S1 is lexicographically less
 +   than, equal to or greater than the initial segment of S2.
 +   Note: This function may, in multibyte locales, return 0 for initial segments
 +   of different lengths!
 +   Unlike strncasecmp(), this function works correctly in multibyte locales.
 +   But beware that N is not a byte count but a character count!  */
 +extern int mbsncasecmp (const char *s1, const char *s2, size_t n);
 +#endif
 +
 +#if @GNULIB_MBSPCASECMP@
 +/* Compare the initial segment of the character string STRING consisting of
 +   at most mbslen (PREFIX) characters with the character string PREFIX,
 +   ignoring case, returning less than, equal to or greater than zero if this
 +   initial segment is lexicographically less than, equal to or greater than
 +   PREFIX.
 +   Note: This function may, in multibyte locales, return 0 if STRING is of
 +   smaller length than PREFIX!
 +   Unlike strncasecmp(), this function works correctly in multibyte
 +   locales.  */
 +extern char * mbspcasecmp (const char *string, const char *prefix);
 +#endif
 +
 +#if @GNULIB_MBSCASESTR@
 +/* Find the first occurrence of the character string NEEDLE in the character
 +   string HAYSTACK, using case-insensitive comparison.
 +   Note: This function may, in multibyte locales, return success even if
 +   strlen (haystack) < strlen (needle) !
 +   Unlike strcasestr(), this function works correctly in multibyte locales.  */
 +extern char * mbscasestr (const char *haystack, const char *needle);
 +#endif
 +
 +#if @GNULIB_MBSCSPN@
 +/* Find the first occurrence in the character string STRING of any character
 +   in the character string ACCEPT.  Return the number of bytes from the
 +   beginning of the string to this occurrence, or to the end of the string
 +   if none exists.
 +   Unlike strcspn(), this function works correctly in multibyte locales.  */
 +extern size_t mbscspn (const char *string, const char *accept);
 +#endif
 +
 +#if @GNULIB_MBSPBRK@
 +/* Find the first occurrence in the character string STRING of any character
 +   in the character string ACCEPT.  Return the pointer to it, or NULL if none
 +   exists.
 +   Unlike strpbrk(), this function works correctly in multibyte locales.  */
 +# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
 +extern char * mbspbrk (const char *string, const char *accept);
 +#endif
 +
 +#if @GNULIB_MBSSPN@
 +/* Find the first occurrence in the character string STRING of any character
 +   not in the character string REJECT.  Return the number of bytes from the
 +   beginning of the string to this occurrence, or to the end of the string
 +   if none exists.
 +   Unlike strspn(), this function works correctly in multibyte locales.  */
 +extern size_t mbsspn (const char *string, const char *reject);
 +#endif
 +
 +#if @GNULIB_MBSSEP@
 +/* Search the next delimiter (multibyte character listed in the character
 +   string DELIM) starting at the character string *STRINGP.
 +   If one is found, overwrite it with a NUL, and advance *STRINGP to point
 +   to the next multibyte character after it.  Otherwise, set *STRINGP to NULL.
 +   If *STRINGP was already NULL, nothing happens.
 +   Return the old value of *STRINGP.
 +
 +   This is a variant of mbstok_r() that supports empty fields.
 +
 +   Caveat: It modifies the original string.
 +   Caveat: These functions cannot be used on constant strings.
 +   Caveat: The identity of the delimiting character is lost.
 +
 +   See also mbstok_r().  */
 +extern char * mbssep (char **stringp, const char *delim);
 +#endif
 +
 +#if @GNULIB_MBSTOK_R@
 +/* Parse the character string STRING into tokens separated by characters in
 +   the character string DELIM.
 +   If STRING is NULL, the saved pointer in SAVE_PTR is used as
 +   the next starting point.  For example:
 +      char s[] = "-abc-=-def";
 +      char *sp;
 +      x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
 +      x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
 +      x = mbstok_r(NULL, "=", &sp);   // x = NULL
 +              // s = "abc\0-def\0"
 +
 +   Caveat: It modifies the original string.
 +   Caveat: These functions cannot be used on constant strings.
 +   Caveat: The identity of the delimiting character is lost.
 +
 +   See also mbssep().  */
 +extern char * mbstok_r (char *string, const char *delim, char **save_ptr);
 +#endif
 +
 +/* Map any int, typically from errno, into an error message.  */
 +#if @GNULIB_STRERROR@
 +# if @REPLACE_STRERROR@
 +#  undef strerror
 +#  define strerror rpl_strerror
 +extern char *strerror (int);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strerror
 +# define strerror(e) \
 +    (GL_LINK_WARNING ("strerror is unportable - " \
 +                      "use gnulib module strerror to guarantee non-NULL result"), \
 +     strerror (e))
 +#endif
 +
 +#if @GNULIB_STRSIGNAL@
 +# if @REPLACE_STRSIGNAL@
 +#  define strsignal rpl_strsignal
 +# endif
 +# if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@
 +extern char *strsignal (int __sig);
 +# endif
 +#elif defined GNULIB_POSIXCHECK
 +# undef strsignal
 +# define strsignal(a) \
 +    (GL_LINK_WARNING ("strsignal is unportable - " \
 +                      "use gnulib module strsignal for portability"), \
 +     strsignal (a))
 +#endif
 +
 +
 +#ifdef __cplusplus
 +}
 +#endif
 +
 +#endif /* _GL_STRING_H */
 +#endif /* _GL_STRING_H */
diff --cc lib/wctype.in.h
index a86b5ad4075b8012ea469281ca539669688c1dea,0000000000000000000000000000000000000000..1bb5228c7ff86db52552d82df35fb71fc9917313
mode 100644,000000..100644
--- /dev/null
@@@ -1,161 -1,0 +1,178 @@@
-    Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 +/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 +
- #if ! @HAVE_ISWCNTRL@
++   Copyright (C) 2006-2008 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
 +   the Free Software Foundation; either version 3, 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, write to the Free Software Foundation,
 +   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 +
 +/* Written by Bruno Haible and Paul Eggert.  */
 +
 +/*
 + * ISO C 99 <wctype.h> for platforms that lack it.
 + * <http://www.opengroup.org/susv3xbd/wctype.h.html>
 + *
 + * iswctype, towctrans, towlower, towupper, wctrans, wctype,
 + * wctrans_t, and wctype_t are not yet implemented.
 + */
 +
 +#ifndef _GL_WCTYPE_H
 +
 +#if @HAVE_WINT_T@
 +/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
 +   Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
 +   <wchar.h>.
 +   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
 +   included before <wchar.h>.  */
 +# include <stddef.h>
 +# include <stdio.h>
 +# include <time.h>
 +# include <wchar.h>
 +#endif
 +
 +/* Include the original <wctype.h> if it exists.
 +   BeOS 5 has the functions but no <wctype.h>.  */
 +/* The include_next requires a split double-inclusion guard.  */
 +#if @HAVE_WCTYPE_H@
 +# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
 +#endif
 +
 +#ifndef _GL_WCTYPE_H
 +#define _GL_WCTYPE_H
 +
 +#if @HAVE_WINT_T@
 +typedef wint_t __wctype_wint_t;
 +#else
 +typedef int __wctype_wint_t;
 +#endif
 +
 +/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
++   Linux libc5 has <wctype.h> and the functions but they are broken.
 +   Assume all 12 functions are implemented the same way, or not at all.  */
++#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
 +
 +/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
 +   undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
 +   refer to system functions like _iswctype that are not in the
 +   standard C library.  Rather than try to get ancient buggy
 +   implementations like this to work, just disable them.  */
 +#  undef iswalnum
 +#  undef iswalpha
 +#  undef iswblank
 +#  undef iswcntrl
 +#  undef iswdigit
 +#  undef iswgraph
 +#  undef iswlower
 +#  undef iswprint
 +#  undef iswpunct
 +#  undef iswspace
 +#  undef iswupper
 +#  undef iswxdigit
 +
++/* Linux libc5 has <wctype.h> and the functions but they are broken.  */
++#  if @REPLACE_ISWCNTRL@
++#   define iswalnum rpl_iswalnum
++#   define iswalpha rpl_iswalpha
++#   define iswblank rpl_iswblank
++#   define iswcntrl rpl_iswcntrl
++#   define iswdigit rpl_iswdigit
++#   define iswgraph rpl_iswgraph
++#   define iswlower rpl_iswlower
++#   define iswprint rpl_iswprint
++#   define iswpunct rpl_iswpunct
++#   define iswspace rpl_iswspace
++#   define iswupper rpl_iswupper
++#   define iswxdigit rpl_iswxdigit
++#  endif
++
 +static inline int
 +iswalnum (__wctype_wint_t wc)
 +{
 +  return ((wc >= '0' && wc <= '9')
 +        || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
 +}
 +
 +static inline int
 +iswalpha (__wctype_wint_t wc)
 +{
 +  return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
 +}
 +
 +static inline int
 +iswblank (__wctype_wint_t wc)
 +{
 +  return wc == ' ' || wc == '\t';
 +}
 +
 +static inline int
 +iswcntrl (__wctype_wint_t wc)
 +{
 +  return (wc & ~0x1f) == 0 || wc == 0x7f;
 +}
 +
 +static inline int
 +iswdigit (__wctype_wint_t wc)
 +{
 +  return wc >= '0' && wc <= '9';
 +}
 +
 +static inline int
 +iswgraph (__wctype_wint_t wc)
 +{
 +  return wc >= '!' && wc <= '~';
 +}
 +
 +static inline int
 +iswlower (__wctype_wint_t wc)
 +{
 +  return wc >= 'a' && wc <= 'z';
 +}
 +
 +static inline int
 +iswprint (__wctype_wint_t wc)
 +{
 +  return wc >= ' ' && wc <= '~';
 +}
 +
 +static inline int
 +iswpunct (__wctype_wint_t wc)
 +{
 +  return (wc >= '!' && wc <= '~'
 +        && !((wc >= '0' && wc <= '9')
 +             || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
 +}
 +
 +static inline int
 +iswspace (__wctype_wint_t wc)
 +{
 +  return (wc == ' ' || wc == '\t'
 +        || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
 +}
 +
 +static inline int
 +iswupper (__wctype_wint_t wc)
 +{
 +  return wc >= 'A' && wc <= 'Z';
 +}
 +
 +static inline int
 +iswxdigit (__wctype_wint_t wc)
 +{
 +  return ((wc >= '0' && wc <= '9')
 +        || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
 +}
 +
 +# endif /* ! HAVE_ISWCNTRL */
 +
 +#endif /* _GL_WCTYPE_H */
 +#endif /* _GL_WCTYPE_H */
diff --cc lib/xalloc.h
index 40dcf4bd54c325ccdb8d291963bcaf8fae15c53c,0000000000000000000000000000000000000000..0f6879f0127c4fa57b8a06470cec3f4091b29f28
mode 100644,000000..100644
--- /dev/null
@@@ -1,270 -1,0 +1,280 @@@
- void *xmalloc (size_t s);
- void *xzalloc (size_t s);
- void *xcalloc (size_t n, size_t s);
 +/* xalloc.h -- malloc with out-of-memory checking
 +
 +   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
 +   1999, 2000, 2003, 2004, 2006, 2007, 2008 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
 +   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/>.  */
 +
 +#ifndef XALLOC_H_
 +# define XALLOC_H_
 +
 +# include <stddef.h>
 +
 +
 +# ifdef __cplusplus
 +extern "C" {
 +# endif
 +
 +
 +# ifndef __attribute__
 +#  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
 +#   define __attribute__(x)
 +#  endif
 +# endif
 +
 +# ifndef ATTRIBUTE_NORETURN
 +#  define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
 +# endif
 +
++# ifndef ATTRIBUTE_MALLOC
++#  if __GNUC__ >= 3
++#   define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
++#  else
++#   define ATTRIBUTE_MALLOC
++#  endif
++# endif
++
 +/* This function is always triggered when memory is exhausted.
 +   It must be defined by the application, either explicitly
 +   or by using gnulib's xalloc-die module.  This is the
 +   function to call when one wants the program to die because of a
 +   memory allocation failure.  */
 +extern void xalloc_die (void) ATTRIBUTE_NORETURN;
 +
- void *xmemdup (void const *p, size_t s);
- char *xstrdup (char const *str);
++void *xmalloc (size_t s) ATTRIBUTE_MALLOC;
++void *xzalloc (size_t s) ATTRIBUTE_MALLOC;
++void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
 +void *xrealloc (void *p, size_t s);
 +void *x2realloc (void *p, size_t *pn);
-    void *xnmalloc (size_t n, size_t s);
++void *xmemdup (void const *p, size_t s) ATTRIBUTE_MALLOC;
++char *xstrdup (char const *str) ATTRIBUTE_MALLOC;
 +
 +/* Return 1 if an array of N objects, each of size S, cannot exist due
 +   to size arithmetic overflow.  S must be positive and N must be
 +   nonnegative.  This is a macro, not an inline function, so that it
 +   works correctly even when SIZE_MAX < N.
 +
 +   By gnulib convention, SIZE_MAX represents overflow in size
 +   calculations, so the conservative dividend to use here is
 +   SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
 +   However, malloc (SIZE_MAX) fails on all known hosts where
 +   sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
 +   exactly-SIZE_MAX allocations on such hosts; this avoids a test and
 +   branch when S is known to be 1.  */
 +# define xalloc_oversized(n, s) \
 +    ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
 +
 +
 +/* In the following macros, T must be an elementary or structure/union or
 +   typedef'ed type, or a pointer to such a type.  To apply one of the
 +   following macros to a function pointer or array type, you need to typedef
 +   it first and use the typedef name.  */
 +
 +/* Allocate an object of type T dynamically, with error checking.  */
 +/* extern t *XMALLOC (typename t); */
 +# define XMALLOC(t) ((t *) xmalloc (sizeof (t)))
 +
 +/* Allocate memory for N elements of type T, with error checking.  */
 +/* extern t *XNMALLOC (size_t n, typename t); */
 +# define XNMALLOC(n, t) \
 +    ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))))
 +
 +/* Allocate an object of type T dynamically, with error checking,
 +   and zero it.  */
 +/* extern t *XZALLOC (typename t); */
 +# define XZALLOC(t) ((t *) xzalloc (sizeof (t)))
 +
 +/* Allocate memory for N elements of type T, with error checking,
 +   and zero it.  */
 +/* extern t *XCALLOC (size_t n, typename t); */
 +# define XCALLOC(n, t) \
 +    ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
 +
 +
 +# if HAVE_INLINE
 +#  define static_inline static inline
 +# else
-    char *xcharalloc (size_t n);
++   void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
 +   void *xnrealloc (void *p, size_t n, size_t s);
 +   void *x2nrealloc (void *p, size_t *pn, size_t s);
++   char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;;
 +# endif
 +
 +# ifdef static_inline
 +
 +/* Allocate an array of N objects, each with S bytes of memory,
 +   dynamically, with error checking.  S must be nonzero.  */
 +
++static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
 +static_inline void *
 +xnmalloc (size_t n, size_t s)
 +{
 +  if (xalloc_oversized (n, s))
 +    xalloc_die ();
 +  return xmalloc (n * s);
 +}
 +
 +/* Change the size of an allocated block of memory P to an array of N
 +   objects each of S bytes, with error checking.  S must be nonzero.  */
 +
 +static_inline void *
 +xnrealloc (void *p, size_t n, size_t s)
 +{
 +  if (xalloc_oversized (n, s))
 +    xalloc_die ();
 +  return xrealloc (p, n * s);
 +}
 +
 +/* If P is null, allocate a block of at least *PN such objects;
 +   otherwise, reallocate P so that it contains more than *PN objects
 +   each of S bytes.  *PN must be nonzero unless P is null, and S must
 +   be nonzero.  Set *PN to the new number of objects, and return the
 +   pointer to the new block.  *PN is never set to zero, and the
 +   returned pointer is never null.
 +
 +   Repeated reallocations are guaranteed to make progress, either by
 +   allocating an initial block with a nonzero size, or by allocating a
 +   larger block.
 +
 +   In the following implementation, nonzero sizes are increased by a
 +   factor of approximately 1.5 so that repeated reallocations have
 +   O(N) overall cost rather than O(N**2) cost, but the
 +   specification for this function does not guarantee that rate.
 +
 +   Here is an example of use:
 +
 +     int *p = NULL;
 +     size_t used = 0;
 +     size_t allocated = 0;
 +
 +     void
 +     append_int (int value)
 +       {
 +       if (used == allocated)
 +         p = x2nrealloc (p, &allocated, sizeof *p);
 +       p[used++] = value;
 +       }
 +
 +   This causes x2nrealloc to allocate a block of some nonzero size the
 +   first time it is called.
 +
 +   To have finer-grained control over the initial size, set *PN to a
 +   nonzero value before calling this function with P == NULL.  For
 +   example:
 +
 +     int *p = NULL;
 +     size_t used = 0;
 +     size_t allocated = 0;
 +     size_t allocated1 = 1000;
 +
 +     void
 +     append_int (int value)
 +       {
 +       if (used == allocated)
 +         {
 +           p = x2nrealloc (p, &allocated1, sizeof *p);
 +           allocated = allocated1;
 +         }
 +       p[used++] = value;
 +       }
 +
 +   */
 +
 +static_inline void *
 +x2nrealloc (void *p, size_t *pn, size_t s)
 +{
 +  size_t n = *pn;
 +
 +  if (! p)
 +    {
 +      if (! n)
 +      {
 +        /* The approximate size to use for initial small allocation
 +           requests, when the invoking code specifies an old size of
 +           zero.  64 bytes is the largest "small" request for the
 +           GNU C library malloc.  */
 +        enum { DEFAULT_MXFAST = 64 };
 +
 +        n = DEFAULT_MXFAST / s;
 +        n += !n;
 +      }
 +    }
 +  else
 +    {
 +      /* Set N = ceil (1.5 * N) so that progress is made if N == 1.
 +       Check for overflow, so that N * S stays in size_t range.
 +       The check is slightly conservative, but an exact check isn't
 +       worth the trouble.  */
 +      if ((size_t) -1 / 3 * 2 / s <= n)
 +      xalloc_die ();
 +      n += (n + 1) / 2;
 +    }
 +
 +  *pn = n;
 +  return xrealloc (p, n * s);
 +}
 +
 +/* Return a pointer to a new buffer of N bytes.  This is like xmalloc,
 +   except it returns char *.  */
 +
++static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
 +static_inline char *
 +xcharalloc (size_t n)
 +{
 +  return XNMALLOC (n, char);
 +}
 +
 +# endif
 +
 +# ifdef __cplusplus
 +}
 +
 +/* C++ does not allow conversions from void * to other pointer types
 +   without a cast.  Use templates to work around the problem when
 +   possible.  */
 +
 +template <typename T> inline T *
 +xrealloc (T *p, size_t s)
 +{
 +  return (T *) xrealloc ((void *) p, s);
 +}
 +
 +template <typename T> inline T *
 +xnrealloc (T *p, size_t n, size_t s)
 +{
 +  return (T *) xnrealloc ((void *) p, n, s);
 +}
 +
 +template <typename T> inline T *
 +x2realloc (T *p, size_t *pn)
 +{
 +  return (T *) x2realloc ((void *) p, pn);
 +}
 +
 +template <typename T> inline T *
 +x2nrealloc (T *p, size_t *pn, size_t s)
 +{
 +  return (T *) x2nrealloc ((void *) p, pn, s);
 +}
 +
 +template <typename T> inline T *
 +xmemdup (T const *p, size_t s)
 +{
 +  return (T *) xmemdup ((void const *) p, s);
 +}
 +
 +# endif
 +
 +
 +#endif /* !XALLOC_H_ */
diff --cc lib/xmalloc.c
index 3a1234574316802700f5e4bec2319200c931fde3,0000000000000000000000000000000000000000..89ecf17ad0851dc47687ac3e323e6743a2f942b3
mode 100644,000000..100644
--- /dev/null
@@@ -1,122 -1,0 +1,122 @@@
-    1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
 +/* xmalloc.c -- malloc with out of memory checking
 +
 +   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
++   1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008 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
 +   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>
 +
 +#if ! HAVE_INLINE
 +# define static_inline
 +#endif
 +#include "xalloc.h"
 +#undef static_inline
 +
 +#include <stdlib.h>
 +#include <string.h>
 +
 +#ifndef SIZE_MAX
 +# define SIZE_MAX ((size_t) -1)
 +#endif
 +
 +/* 1 if calloc is known to be compatible with GNU calloc.  This
 +   matters if we are not also using the calloc module, which defines
 +   HAVE_CALLOC and supports the GNU API even on non-GNU platforms.  */
 +#if defined HAVE_CALLOC || defined __GLIBC__
 +enum { HAVE_GNU_CALLOC = 1 };
 +#else
 +enum { HAVE_GNU_CALLOC = 0 };
 +#endif
 +
 +/* Allocate N bytes of memory dynamically, with error checking.  */
 +
 +void *
 +xmalloc (size_t n)
 +{
 +  void *p = malloc (n);
 +  if (!p && n != 0)
 +    xalloc_die ();
 +  return p;
 +}
 +
 +/* Change the size of an allocated block of memory P to N bytes,
 +   with error checking.  */
 +
 +void *
 +xrealloc (void *p, size_t n)
 +{
 +  p = realloc (p, n);
 +  if (!p && n != 0)
 +    xalloc_die ();
 +  return p;
 +}
 +
 +/* If P is null, allocate a block of at least *PN bytes; otherwise,
 +   reallocate P so that it contains more than *PN bytes.  *PN must be
 +   nonzero unless P is null.  Set *PN to the new block's size, and
 +   return the pointer to the new block.  *PN is never set to zero, and
 +   the returned pointer is never null.  */
 +
 +void *
 +x2realloc (void *p, size_t *pn)
 +{
 +  return x2nrealloc (p, pn, 1);
 +}
 +
 +/* Allocate S bytes of zeroed memory dynamically, with error checking.
 +   There's no need for xnzalloc (N, S), since it would be equivalent
 +   to xcalloc (N, S).  */
 +
 +void *
 +xzalloc (size_t s)
 +{
 +  return memset (xmalloc (s), 0, s);
 +}
 +
 +/* Allocate zeroed memory for N elements of S bytes, with error
 +   checking.  S must be nonzero.  */
 +
 +void *
 +xcalloc (size_t n, size_t s)
 +{
 +  void *p;
 +  /* Test for overflow, since some calloc implementations don't have
 +     proper overflow checks.  But omit overflow and size-zero tests if
 +     HAVE_GNU_CALLOC, since GNU calloc catches overflow and never
 +     returns NULL if successful.  */
 +  if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s))
 +      || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0)))
 +    xalloc_die ();
 +  return p;
 +}
 +
 +/* Clone an object P of size S, with error checking.  There's no need
 +   for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
 +   need for an arithmetic overflow check.  */
 +
 +void *
 +xmemdup (void const *p, size_t s)
 +{
 +  return memcpy (xmalloc (s), p, s);
 +}
 +
 +/* Clone STRING.  */
 +
 +char *
 +xstrdup (char const *string)
 +{
 +  return xmemdup (string, strlen (string) + 1);
 +}
index bcbb3ceee2c30bd23176dcd1e55af74185b7ec1b,bcbb3ceee2c30bd23176dcd1e55af74185b7ec1b..917af9480549ed985f0d4a1e84b9e19a8f2a83ee
@@@ -1,7 -1,7 +1,7 @@@
  # serial 5  -*- Autoconf -*-
  # Enable extensions on systems that normally disable them.
  
--# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
++# Copyright (C) 2003, 2006-2008 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.
@@@ -61,9 -61,9 +61,9 @@@ AC_BEFORE([$0], [AC_RUN_IFELSE])dn
    AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
      [ac_cv_safe_to_define___extensions__],
      [AC_COMPILE_IFELSE(
--       [AC_LANG_PROGRAM([
++       [AC_LANG_PROGRAM([[
  #       define __EXTENSIONS__ 1
--        AC_INCLUDES_DEFAULT])],
++        ]AC_INCLUDES_DEFAULT])],
         [ac_cv_safe_to_define___extensions__=yes],
         [ac_cv_safe_to_define___extensions__=no])])
    test $ac_cv_safe_to_define___extensions__ = yes &&
diff --cc m4/getopt.m4
index c0a73b2cb803aeb637f7f2db1b503e5e55b4da14,c0a73b2cb803aeb637f7f2db1b503e5e55b4da14..9b683c2febbd599f6a8351105b01ff4633996b33
@@@ -1,5 -1,5 +1,5 @@@
--# getopt.m4 serial 13
--dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
++# getopt.m4 serial 14
++dnl Copyright (C) 2002-2006, 2008 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.
@@@ -46,7 -46,7 +46,7 @@@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS]
    if test -z "$GETOPT_H"; then
      AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
        [AC_RUN_IFELSE(
--      [AC_LANG_PROGRAM([#include <getopt.h>],
++      [AC_LANG_PROGRAM([[#include <getopt.h>]],
           [[
             char *myargv[3];
             myargv[0] = "conftest";
index 540607bb2a54bf015eb0cccd8fa6c2d9cd2e3d6f,d78f7bb797eab416a692286f58e9c3d2c82bc902..ba4a7d8d28b08cf4b6b096d6eb0b24f186c346d5
  
  
  # Specification in the form of a command-line invocation:
- #   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl alloca c-ctype getopt maintainer-makefile quote
 -#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl c-ctype getopt getpass-gnu maintainer-makefile
++#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl alloca c-ctype getopt getpass-gnu maintainer-makefile quote
  
  # Specification in the form of a few gnulib-tool.m4 macro invocations:
  gl_LOCAL_DIR([])
- gl_MODULES([alloca c-ctype getopt maintainer-makefile quote])
 -gl_MODULES([c-ctype getopt getpass-gnu maintainer-makefile])
++gl_MODULES([alloca c-ctype getopt getpass-gnu maintainer-makefile quote])
  gl_AVOID([])
  gl_SOURCE_BASE([lib])
  gl_M4_BASE([m4])
index 3edfc120f81f9a135aeab6c15994b2327f414f1c,3edfc120f81f9a135aeab6c15994b2327f414f1c..34d91c728f0765ebfd801df3973604d15814c9d9
@@@ -1,4 -1,4 +1,4 @@@
--# gnulib-common.m4 serial 4
++# gnulib-common.m4 serial 5
  dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
@@@ -31,6 -31,6 +31,13 @@@ AC_DEFUN([gl_MODULE_INDICATOR]
      [Define to 1 when using the gnulib module ]$1[.])
  ])
  
++# m4_foreach_w
++# is a backport of autoconf-2.59c's m4_foreach_w.
++# Remove this macro when we can assume autoconf >= 2.60.
++m4_ifndef([m4_foreach_w],
++  [m4_define([m4_foreach_w],
++    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
++
  # AC_PROG_MKDIR_P
  # is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
  # Remove this macro when we can assume autoconf >= 2.60.
index 7ea55d9e05935b6a685e491b66ec13cd30f1613a,d26352e78f5527e27325b1509d268f4225c4de8d..5cd73ad0b1c9f627bbea926bc7197f03ccde2fe7
@@@ -39,15 -39,15 +39,23 @@@ AC_DEFUN([gl_INIT]
    m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
    m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
    m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
++  m4_pushdef([gl_LIBSOURCES_LIST], [])
++  m4_pushdef([gl_LIBSOURCES_DIR], [])
    gl_COMMON
    gl_source_base='lib'
+   gl_EOVERFLOW
 +  gl_FUNC_ALLOCA
 +  gl_ERROR
 +  m4_ifdef([AM_XGETTEXT_OPTION],
 +    [AM_XGETTEXT_OPTION([--flag=error:3:c-format])
 +     AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
 +  gl_EXITFAIL
+   gl_FUNC_GETDELIM
+   gl_STDIO_MODULE_INDICATOR([getdelim])
+   gl_FUNC_GETLINE
+   gl_STDIO_MODULE_INDICATOR([getline])
    gl_GETOPT
+   gl_FUNC_GETPASS_GNU
    AC_SUBST([LIBINTL])
    AC_SUBST([LTLIBINTL])
    # Autoconf 2.61a.99 and earlier don't support linking a file only
        m4_defn([m4_PACKAGE_VERSION])), [1], [],
          [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
        [GNUmakefile=$GNUmakefile])])
 +  gl_INLINE
 +  gl_QUOTE
 +  gl_QUOTEARG
+   gl_FUNC_REALLOC_POSIX
+   gl_STDLIB_MODULE_INDICATOR([realloc-posix])
    AM_STDBOOL_H
+   gl_STDIO_H
    gl_STDLIB_H
 +  gl_FUNC_STRERROR
 +  gl_STRING_MODULE_INDICATOR([strerror])
 +  gl_HEADER_STRING_H
    gl_UNISTD_H
 +  gl_WCHAR_H
 +  gl_WCTYPE_H
 +  gl_XALLOC
++  m4_ifval(gl_LIBSOURCES_LIST, [
++    m4_syscmd([test ! -d ]gl_LIBSOURCES_DIR[ ||
++      for gl_file in ]gl_LIBSOURCES_LIST[ ; do
++        if test ! -r ]gl_LIBSOURCES_DIR[/$gl_file ; then
++          echo "missing file ]gl_LIBSOURCES_DIR[/$gl_file" >&2
++          exit 1
++        fi
++      done])dnl
++      m4_if(m4_sysval, [0], [],
++        [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
++  ])
++  m4_popdef([gl_LIBSOURCES_DIR])
++  m4_popdef([gl_LIBSOURCES_LIST])
    m4_popdef([AC_LIBSOURCES])
    m4_popdef([AC_REPLACE_FUNCS])
    m4_popdef([AC_LIBOBJ])
    m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
    m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
    m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
++  m4_pushdef([gltests_LIBSOURCES_LIST], [])
++  m4_pushdef([gltests_LIBSOURCES_DIR], [])
    gl_COMMON
    gl_source_base='tests'
++  m4_ifval(gltests_LIBSOURCES_LIST, [
++    m4_syscmd([test ! -d ]gltests_LIBSOURCES_DIR[ ||
++      for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
++        if test ! -r ]gltests_LIBSOURCES_DIR[/$gl_file ; then
++          echo "missing file ]gltests_LIBSOURCES_DIR[/$gl_file" >&2
++          exit 1
++        fi
++      done])dnl
++      m4_if(m4_sysval, [0], [],
++        [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
++  ])
++  m4_popdef([gltests_LIBSOURCES_DIR])
++  m4_popdef([gltests_LIBSOURCES_LIST])
    m4_popdef([AC_LIBSOURCES])
    m4_popdef([AC_REPLACE_FUNCS])
    m4_popdef([AC_LIBOBJ])
@@@ -126,13 -120,13 +165,6 @@@ AC_DEFUN([gl_LIBOBJ], 
    gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
  ])
  
--# m4_foreach_w is provided by autoconf-2.59c and later.
--# This definition is to accommodate developers using versions
--# of autoconf older than that.
--m4_ifndef([m4_foreach_w],
--  [m4_define([m4_foreach_w],
--    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
--
  # Like AC_REPLACE_FUNCS, except that the module name goes
  # into gl_LIBOBJS instead of into LIBOBJS.
  AC_DEFUN([gl_REPLACE_FUNCS], [
  ])
  
  # Like AC_LIBSOURCES, except the directory where the source file is
--# expected is derived from the gnulib-tool parametrization,
++# expected is derived from the gnulib-tool parameterization,
  # and alloca is special cased (for the alloca-opt module).
  # We could also entirely rely on EXTRA_lib..._SOURCES.
  AC_DEFUN([gl_LIBSOURCES], [
    m4_foreach([_gl_NAME], [$1], [
      m4_if(_gl_NAME, [alloca.c], [], [
--      m4_syscmd([test -r lib/]_gl_NAME[ || test ! -d lib])dnl
--      m4_if(m4_sysval, [0], [],
--        [AC_FATAL([missing lib/]_gl_NAME)])
++      m4_define([gl_LIBSOURCES_DIR], [lib])
++      m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
      ])
    ])
  ])
@@@ -161,13 -155,13 +192,6 @@@ AC_DEFUN([gltests_LIBOBJ], 
    gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
  ])
  
--# m4_foreach_w is provided by autoconf-2.59c and later.
--# This definition is to accommodate developers using versions
--# of autoconf older than that.
--m4_ifndef([m4_foreach_w],
--  [m4_define([m4_foreach_w],
--    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
--
  # Like AC_REPLACE_FUNCS, except that the module name goes
  # into gltests_LIBOBJS instead of into LIBOBJS.
  AC_DEFUN([gltests_REPLACE_FUNCS], [
  ])
  
  # Like AC_LIBSOURCES, except the directory where the source file is
--# expected is derived from the gnulib-tool parametrization,
++# expected is derived from the gnulib-tool parameterization,
  # and alloca is special cased (for the alloca-opt module).
  # We could also entirely rely on EXTRA_lib..._SOURCES.
  AC_DEFUN([gltests_LIBSOURCES], [
    m4_foreach([_gl_NAME], [$1], [
      m4_if(_gl_NAME, [alloca.c], [], [
--      m4_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl
--      m4_if(m4_sysval, [0], [],
--        [AC_FATAL([missing tests/]_gl_NAME)])
++      m4_define([gltests_LIBSOURCES_DIR], [tests])
++      m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
      ])
    ])
  ])
  # gnulib-tool and may be removed by future gnulib-tool invocations.
  AC_DEFUN([gl_FILE_LIST], [
    build-aux/link-warning.h
 +  lib/alloca.c
 +  lib/alloca.in.h
    lib/c-ctype.c
    lib/c-ctype.h
 +  lib/error.c
 +  lib/error.h
 +  lib/exitfail.c
 +  lib/exitfail.h
+   lib/getdelim.c
+   lib/getline.c
    lib/getopt.c
    lib/getopt.in.h
    lib/getopt1.c
    lib/getopt_int.h
+   lib/getpass.c
+   lib/getpass.h
    lib/gettext.h
 +  lib/intprops.h
 +  lib/quote.c
 +  lib/quote.h
 +  lib/quotearg.c
 +  lib/quotearg.h
+   lib/realloc.c
    lib/stdbool.in.h
+   lib/stdio.in.h
    lib/stdlib.in.h
 +  lib/strerror.c
 +  lib/string.in.h
    lib/unistd.in.h
 +  lib/wchar.in.h
 +  lib/wctype.in.h
 +  lib/xalloc-die.c
 +  lib/xalloc.h
 +  lib/xmalloc.c
 +  m4/alloca.m4
+   m4/eoverflow.m4
 +  m4/error.m4
 +  m4/exitfail.m4
    m4/extensions.m4
+   m4/getdelim.m4
+   m4/getline.m4
    m4/getopt.m4
+   m4/getpass.m4
    m4/gnulib-common.m4
    m4/include_next.m4
 +  m4/inline.m4
+   m4/malloc.m4
 +  m4/mbrtowc.m4
 +  m4/mbstate_t.m4
 +  m4/quote.m4
 +  m4/quotearg.m4
+   m4/realloc.m4
    m4/stdbool.m4
+   m4/stdio_h.m4
    m4/stdlib_h.m4
 +  m4/strerror.m4
 +  m4/string_h.m4
    m4/unistd_h.m4
 +  m4/wchar.m4
 +  m4/wctype.m4
 +  m4/wint_t.m4
 +  m4/xalloc.m4
    top/GNUmakefile
    top/maint.mk
  ])
diff --cc m4/mbstate_t.m4
index df2a275c2eab6a08d7d0b65fa7ee4e6ae230c7e9,0000000000000000000000000000000000000000..0da32b6b48b84065765f741d6ae914b1fe24eea0
mode 100644,000000..100644
--- /dev/null
@@@ -1,30 -1,0 +1,30 @@@
- # mbstate_t.m4 serial 9
- dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
++# mbstate_t.m4 serial 10
++dnl Copyright (C) 2000-2002, 2008 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.
 +
 +# From Paul Eggert.
 +
 +# BeOS 5 has <wchar.h> but does not define mbstate_t,
 +# so you can't declare an object of that type.
 +# Check for this incompatibility with Standard C.
 +
 +# AC_TYPE_MBSTATE_T
 +# -----------------
 +AC_DEFUN([AC_TYPE_MBSTATE_T],
 +  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
 +     [AC_COMPILE_IFELSE(
 +      [AC_LANG_PROGRAM(
-          [AC_INCLUDES_DEFAULT
- #         include <wchar.h>],
-          [mbstate_t x; return sizeof x;])],
++         [AC_INCLUDES_DEFAULT[
++#         include <wchar.h>]],
++         [[mbstate_t x; return sizeof x;]])],
 +      [ac_cv_type_mbstate_t=yes],
 +      [ac_cv_type_mbstate_t=no])])
 +   if test $ac_cv_type_mbstate_t = yes; then
 +     AC_DEFINE([HAVE_MBSTATE_T], 1,
 +             [Define to 1 if <wchar.h> declares mbstate_t.])
 +   else
 +     AC_DEFINE([mbstate_t], int,
 +             [Define to a type if <wchar.h> does not define.])
 +   fi])
diff --cc m4/stdio_h.m4
index 0000000000000000000000000000000000000000,a40d41804199e9d99c7d6bac761ea02cde36f4c5..fa262e359c304269ca78c289559f3e07aa5dca5c
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,85 +1,85 @@@
 -# stdio_h.m4 serial 9
 -dnl Copyright (C) 2007 Free Software Foundation, Inc.
++# stdio_h.m4 serial 10
++dnl Copyright (C) 2007-2008 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_STDIO_H],
+ [
+   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+   gl_CHECK_NEXT_HEADERS([stdio.h])
+ ])
+ AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
+ [
+   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+   GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+ ])
+ AC_DEFUN([gl_STDIO_H_DEFAULTS],
+ [
+   GNULIB_FPRINTF_POSIX=0;  AC_SUBST([GNULIB_FPRINTF_POSIX])
+   GNULIB_PRINTF_POSIX=0;   AC_SUBST([GNULIB_PRINTF_POSIX])
+   GNULIB_SNPRINTF=0;       AC_SUBST([GNULIB_SNPRINTF])
+   GNULIB_SPRINTF_POSIX=0;  AC_SUBST([GNULIB_SPRINTF_POSIX])
+   GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
+   GNULIB_VPRINTF_POSIX=0;  AC_SUBST([GNULIB_VPRINTF_POSIX])
+   GNULIB_VSNPRINTF=0;      AC_SUBST([GNULIB_VSNPRINTF])
+   GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
+   GNULIB_VASPRINTF=0;      AC_SUBST([GNULIB_VASPRINTF])
+   GNULIB_FOPEN=0;          AC_SUBST([GNULIB_FOPEN])
+   GNULIB_FREOPEN=0;        AC_SUBST([GNULIB_FREOPEN])
+   GNULIB_FSEEK=0;          AC_SUBST([GNULIB_FSEEK])
+   GNULIB_FSEEKO=0;         AC_SUBST([GNULIB_FSEEKO])
+   GNULIB_FTELL=0;          AC_SUBST([GNULIB_FTELL])
+   GNULIB_FTELLO=0;         AC_SUBST([GNULIB_FTELLO])
+   GNULIB_FFLUSH=0;         AC_SUBST([GNULIB_FFLUSH])
+   GNULIB_GETDELIM=0;       AC_SUBST([GNULIB_GETDELIM])
+   GNULIB_GETLINE=0;        AC_SUBST([GNULIB_GETLINE])
+   dnl Assume proper GNU behavior unless another module says otherwise.
+   REPLACE_FPRINTF=0;       AC_SUBST([REPLACE_FPRINTF])
+   REPLACE_VFPRINTF=0;      AC_SUBST([REPLACE_VFPRINTF])
+   REPLACE_PRINTF=0;        AC_SUBST([REPLACE_PRINTF])
+   REPLACE_VPRINTF=0;       AC_SUBST([REPLACE_VPRINTF])
+   REPLACE_SNPRINTF=0;      AC_SUBST([REPLACE_SNPRINTF])
+   HAVE_DECL_SNPRINTF=1;    AC_SUBST([HAVE_DECL_SNPRINTF])
+   REPLACE_VSNPRINTF=0;     AC_SUBST([REPLACE_VSNPRINTF])
+   HAVE_DECL_VSNPRINTF=1;   AC_SUBST([HAVE_DECL_VSNPRINTF])
+   REPLACE_SPRINTF=0;       AC_SUBST([REPLACE_SPRINTF])
+   REPLACE_VSPRINTF=0;      AC_SUBST([REPLACE_VSPRINTF])
+   HAVE_VASPRINTF=1;        AC_SUBST([HAVE_VASPRINTF])
+   REPLACE_VASPRINTF=0;     AC_SUBST([REPLACE_VASPRINTF])
+   REPLACE_FOPEN=0;         AC_SUBST([REPLACE_FOPEN])
+   REPLACE_FREOPEN=0;       AC_SUBST([REPLACE_FREOPEN])
+   HAVE_FSEEKO=1;           AC_SUBST([HAVE_FSEEKO])
+   REPLACE_FSEEKO=0;        AC_SUBST([REPLACE_FSEEKO])
+   REPLACE_FSEEK=0;         AC_SUBST([REPLACE_FSEEK])
+   HAVE_FTELLO=1;           AC_SUBST([HAVE_FTELLO])
+   REPLACE_FTELLO=0;        AC_SUBST([REPLACE_FTELLO])
+   REPLACE_FTELL=0;         AC_SUBST([REPLACE_FTELL])
+   REPLACE_FFLUSH=0;        AC_SUBST([REPLACE_FFLUSH])
+   HAVE_DECL_GETDELIM=1;    AC_SUBST([HAVE_DECL_GETDELIM])
+   HAVE_DECL_GETLINE=1;     AC_SUBST([HAVE_DECL_GETLINE])
+   REPLACE_GETLINE=0;       AC_SUBST([REPLACE_GETLINE])
+ ])
+ dnl Code shared by fseeko and ftello.  Determine if large files are supported,
+ dnl but stdin does not start as a large file by default.
+ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
+   [
+     AC_CACHE_CHECK([whether stdin defaults to large file offsets],
+       [gl_cv_var_stdin_large_offset],
 -      [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],
 -[#if defined __SL64 && defined __SCLE /* cygwin */
++      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
++[[#if defined __SL64 && defined __SCLE /* cygwin */
+   /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+      fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
+      it is easier to do a version check than building a runtime test.  */
+ # include <cygwin/version.h>
+ # if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+   choke me
+ # endif
 -#endif])],
++#endif]])],
+       [gl_cv_var_stdin_large_offset=yes],
+       [gl_cv_var_stdin_large_offset=no])])
+ ])
diff --cc m4/stdlib_h.m4
index d9240b46a0d48f72215f79207086444b87d3765c,d9240b46a0d48f72215f79207086444b87d3765c..95e679f7971d8b33e40f4a6160cb3f2a8614cfb3
@@@ -1,4 -1,4 +1,4 @@@
--# stdlib_h.m4 serial 6
++# stdlib_h.m4 serial 7
  dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
@@@ -26,6 -26,6 +26,7 @@@ AC_DEFUN([gl_STDLIB_H_DEFAULTS]
    GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
    GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
    GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
++  GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
    GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
    GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
    GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
@@@ -35,6 -35,6 +36,7 @@@
    HAVE_MALLOC_POSIX=1;    AC_SUBST([HAVE_MALLOC_POSIX])
    HAVE_MKDTEMP=1;         AC_SUBST([HAVE_MKDTEMP])
    HAVE_REALLOC_POSIX=1;   AC_SUBST([HAVE_REALLOC_POSIX])
++  HAVE_RPMATCH=1;         AC_SUBST([HAVE_RPMATCH])
    HAVE_SETENV=1;          AC_SUBST([HAVE_SETENV])
    HAVE_STRTOD=1;          AC_SUBST([HAVE_STRTOD])
    HAVE_UNSETENV=1;        AC_SUBST([HAVE_UNSETENV])
diff --cc m4/strerror.m4
index eb7d45aab205dd2c63a690ee2b56348fedb8e9ea,0000000000000000000000000000000000000000..75d54621b1be315d0476c9f1651fc338964d281a
mode 100644,000000..100644
--- /dev/null
@@@ -1,47 -1,0 +1,47 @@@
- # strerror.m4 serial 7
- dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc.
++# strerror.m4 serial 8
++dnl Copyright (C) 2002, 2007-2008 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_STRERROR],
 +[
 +  AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
 +  if test $gl_cv_func_working_strerror = no; then
 +    AC_LIBOBJ([strerror])
 +    AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
 +      [Define this to 1 if strerror is broken.])
 +  fi
 +])
 +
 +# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
 +AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
 +[
 +  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
 +  AC_CACHE_CHECK([for working strerror function],
 +   [gl_cv_func_working_strerror],
 +   [AC_RUN_IFELSE(
 +      [AC_LANG_PROGRAM(
-        [#include <string.h>
-        ],
-        [return !*strerror (-2);])],
++       [[#include <string.h>
++       ]],
++       [[return !*strerror (-2);]])],
 +      [gl_cv_func_working_strerror=yes],
 +      [gl_cv_func_working_strerror=no],
 +      [dnl Assume crossbuild works if it compiles.
 +       AC_COMPILE_IFELSE(
 +       [AC_LANG_PROGRAM(
-           [#include <string.h>
-           ],
-           [return !*strerror (-2);])],
++          [[#include <string.h>
++          ]],
++          [[return !*strerror (-2);]])],
 +       [gl_cv_func_working_strerror=yes],
 +       [gl_cv_func_working_strerror=no])])])
 +  if test $gl_cv_func_working_strerror = no ; then
 +    REPLACE_STRERROR=1
 +    gl_PREREQ_STRERROR
 +  fi
 +])
 +
 +# Prerequisites of lib/strerror.c.
 +AC_DEFUN([gl_PREREQ_STRERROR], [
 +  AC_CHECK_DECLS([strerror])
 +])
diff --cc m4/string_h.m4
index 766d7e984948bb6bf9cc80e18bbc01e18cd8f8ea,0000000000000000000000000000000000000000..7143690ebf695725b2f776a6d394e340704fc8c3
mode 100644,000000..100644
--- /dev/null
@@@ -1,87 -1,0 +1,89 @@@
 +# Configure a GNU-like replacement for <string.h>.
 +
 +# Copyright (C) 2007, 2008 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.
 +
 +# serial 4
 +
 +# Written by Paul Eggert.
 +
 +AC_DEFUN([gl_HEADER_STRING_H],
 +[
 +  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
 +  dnl once only, before all statements that occur in other macros.
 +  AC_REQUIRE([gl_HEADER_STRING_H_BODY])
 +])
 +
 +AC_DEFUN([gl_HEADER_STRING_H_BODY],
 +[
 +  AC_REQUIRE([AC_C_RESTRICT])
 +  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
 +  gl_CHECK_NEXT_HEADERS([string.h])
 +])
 +
 +AC_DEFUN([gl_STRING_MODULE_INDICATOR],
 +[
 +  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
 +  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
 +  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
 +])
 +
 +AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
 +[
 +  GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
 +  GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
 +  GNULIB_MEMRCHR=0;     AC_SUBST([GNULIB_MEMRCHR])
++  GNULIB_RAWMEMCHR=0;   AC_SUBST([GNULIB_RAWMEMCHR])
 +  GNULIB_STPCPY=0;      AC_SUBST([GNULIB_STPCPY])
 +  GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
 +  GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
 +  GNULIB_STRDUP=0;      AC_SUBST([GNULIB_STRDUP])
 +  GNULIB_STRNDUP=0;     AC_SUBST([GNULIB_STRNDUP])
 +  GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
 +  GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
 +  GNULIB_STRSEP=0;      AC_SUBST([GNULIB_STRSEP])
 +  GNULIB_STRSTR=0;      AC_SUBST([GNULIB_STRSTR])
 +  GNULIB_STRCASESTR=0;  AC_SUBST([GNULIB_STRCASESTR])
 +  GNULIB_STRTOK_R=0;    AC_SUBST([GNULIB_STRTOK_R])
 +  GNULIB_MBSLEN=0;      AC_SUBST([GNULIB_MBSLEN])
 +  GNULIB_MBSNLEN=0;     AC_SUBST([GNULIB_MBSNLEN])
 +  GNULIB_MBSCHR=0;      AC_SUBST([GNULIB_MBSCHR])
 +  GNULIB_MBSRCHR=0;     AC_SUBST([GNULIB_MBSRCHR])
 +  GNULIB_MBSSTR=0;      AC_SUBST([GNULIB_MBSSTR])
 +  GNULIB_MBSCASECMP=0;  AC_SUBST([GNULIB_MBSCASECMP])
 +  GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
 +  GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
 +  GNULIB_MBSCASESTR=0;  AC_SUBST([GNULIB_MBSCASESTR])
 +  GNULIB_MBSCSPN=0;     AC_SUBST([GNULIB_MBSCSPN])
 +  GNULIB_MBSPBRK=0;     AC_SUBST([GNULIB_MBSPBRK])
 +  GNULIB_MBSSPN=0;      AC_SUBST([GNULIB_MBSSPN])
 +  GNULIB_MBSSEP=0;      AC_SUBST([GNULIB_MBSSEP])
 +  GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
 +  GNULIB_STRERROR=0;    AC_SUBST([GNULIB_STRERROR])
 +  GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
 +  dnl Assume proper GNU behavior unless another module says otherwise.
 +  HAVE_DECL_MEMMEM=1;         AC_SUBST([HAVE_DECL_MEMMEM])
 +  HAVE_MEMPCPY=1;             AC_SUBST([HAVE_MEMPCPY])
 +  HAVE_DECL_MEMRCHR=1;                AC_SUBST([HAVE_DECL_MEMRCHR])
++  HAVE_RAWMEMCHR=1;           AC_SUBST([HAVE_RAWMEMCHR])
 +  HAVE_STPCPY=1;              AC_SUBST([HAVE_STPCPY])
 +  HAVE_STPNCPY=1;             AC_SUBST([HAVE_STPNCPY])
 +  HAVE_STRCHRNUL=1;           AC_SUBST([HAVE_STRCHRNUL])
 +  HAVE_DECL_STRDUP=1;         AC_SUBST([HAVE_DECL_STRDUP])
 +  HAVE_STRNDUP=1;             AC_SUBST([HAVE_STRNDUP])
 +  HAVE_DECL_STRNDUP=1;                AC_SUBST([HAVE_DECL_STRNDUP])
 +  HAVE_DECL_STRNLEN=1;                AC_SUBST([HAVE_DECL_STRNLEN])
 +  HAVE_STRPBRK=1;             AC_SUBST([HAVE_STRPBRK])
 +  HAVE_STRSEP=1;              AC_SUBST([HAVE_STRSEP])
 +  HAVE_STRCASESTR=1;          AC_SUBST([HAVE_STRCASESTR])
 +  HAVE_DECL_STRTOK_R=1;               AC_SUBST([HAVE_DECL_STRTOK_R])
 +  HAVE_DECL_STRERROR=1;               AC_SUBST([HAVE_DECL_STRERROR])
 +  HAVE_DECL_STRSIGNAL=1;      AC_SUBST([HAVE_DECL_STRSIGNAL])
 +  REPLACE_STRERROR=0;         AC_SUBST([REPLACE_STRERROR])
 +  REPLACE_STRSIGNAL=0;                AC_SUBST([REPLACE_STRSIGNAL])
 +  REPLACE_MEMMEM=0;           AC_SUBST([REPLACE_MEMMEM])
 +  REPLACE_STRCASESTR=0;               AC_SUBST([REPLACE_STRCASESTR])
 +  REPLACE_STRSTR=0;           AC_SUBST([REPLACE_STRSTR])
 +])
diff --cc m4/wctype.m4
index 7483c4feaf521d8618d7da883e32b45f9a806729,0000000000000000000000000000000000000000..6a1b6f07f482838d4e2faeafa7474c368336d716
mode 100644,000000..100644
--- /dev/null
@@@ -1,44 -1,0 +1,74 @@@
- dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
++# wctype.m4 serial 2
++
 +dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 +
-       WCTYPE_H=
++dnl Copyright (C) 2006-2008 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.
 +
 +dnl Written by Paul Eggert.
 +
 +AC_DEFUN([gl_WCTYPE_H],
 +[
++  AC_REQUIRE([AC_PROG_CC])
 +  AC_CHECK_FUNCS_ONCE([iswcntrl])
 +  if test $ac_cv_func_iswcntrl = yes; then
 +    HAVE_ISWCNTRL=1
 +  else
 +    HAVE_ISWCNTRL=0
 +  fi
 +  AC_SUBST([HAVE_ISWCNTRL])
 +  AC_CHECK_HEADERS_ONCE([wctype.h])
 +  AC_REQUIRE([AC_C_INLINE])
 +
 +  AC_REQUIRE([gt_TYPE_WINT_T])
 +  if test $gt_cv_c_wint_t = yes; then
 +    HAVE_WINT_T=1
 +  else
 +    HAVE_WINT_T=0
 +  fi
 +  AC_SUBST([HAVE_WINT_T])
 +
 +  WCTYPE_H=wctype.h
 +  if test $ac_cv_header_wctype_h = yes; then
 +    if test $ac_cv_func_iswcntrl = yes; then
++      dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
++      dnl The other functions are likely broken in the same way.
++      AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
++        [
++          AC_TRY_RUN([#include <stddef.h>
++                      #include <stdio.h>
++                      #include <time.h>
++                      #include <wchar.h>
++                      #include <wctype.h>
++                      int main () { return iswprint ('x') == 0; }],
++            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
++            [AC_TRY_COMPILE([#include <stdlib.h>
++                          #if __GNU_LIBRARY__ == 1
++                          Linux libc5 i18n is broken.
++                          #endif], [],
++              [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
++            ])
++        ])
++      if test $gl_cv_func_iswcntrl_works = yes; then
++        WCTYPE_H=
++      fi
 +    fi
 +    dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
 +    dnl for the benefit of builds from non-distclean directories.
 +    gl_CHECK_NEXT_HEADERS([wctype.h])
 +    HAVE_WCTYPE_H=1
 +  else
 +    HAVE_WCTYPE_H=0
 +  fi
 +  AC_SUBST([HAVE_WCTYPE_H])
 +  AC_SUBST([WCTYPE_H])
++
++  if test "$gl_cv_func_iswcntrl_works" = no; then
++    REPLACE_ISWCNTRL=1
++  else
++    REPLACE_ISWCNTRL=0
++  fi
++  AC_SUBST([REPLACE_ISWCNTRL])
 +])
diff --cc src/ChangeLog
index f223d3593557a42dae456ceae2bfcd5b7108c689,3c0d9cf971a5b5cede10109691561d939d4380e1..5eef2bd6c7fbb4a2150ad08dd635958f48b82b30
@@@ -1,19 -1,18 +1,34 @@@
 +2008-05-14  Micah Cowan  <micah@cowan.name>
 +
 +      * ftp.c (ftp_retrieve_list): Symlinks and other filenames
 +      should be fully quoted.
 +
 +2008-05-12  Micah Cowan  <micah@cowan.name>
 +
 +      * main.c (main): Downgrade "-N with -O" to a warning, and switch
 +      it off to avoid confusing messages.
 +
 +2008-04-30  Micah Cowan  <micah@cowan.name>
 +
 +      * progress.c (create_image): Fix glitch where too many spaces are
 +      printed on lines that don't display the ETA, in multibyte
 +      locales.
 +
+ 2008-04-30  Steven Schubiger  <stsc@members.fsf.org>
+       * main.c (main): New code that handles prompting for passwords
+       when specified explicitly via command-line option (using gnulib's
+       getpass-gnu module).
+       (main): Include the getpass header.
+       * init.c: Add "ask-password" to the list of recognized commands.
+       * options.h: Add an according boolean member to the options
+       struct.
+       
+       * sysdep.h: Comment the defines __EXTENSIONS__ and _GNU_SOURCE
+       out, because they're now defined independently by config.h.
  2008-04-27  Rabin Vincent  <rabin@rab.in>
  
        * http.c (http_loop): Fix return for the case where we don't
diff --cc src/init.c
Simple merge
diff --cc src/main.c
Simple merge