summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/Makefile.in29
-rw-r--r--lib/fnmatch.c2
-rw-r--r--lib/fnmatch_loop.c4
-rw-r--r--lib/getopt.c82
-rw-r--r--lib/quotearg.c10
-rw-r--r--lib/regex_internal.h9
-rw-r--r--lib/stdbool_.h38
8 files changed, 78 insertions, 97 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 215d4b6..9c1f30e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -16,6 +16,7 @@ noinst_LIBRARIES = libgnu.a
libgnu_a_SOURCES =
libgnu_a_LIBADD = @LIBOBJS@
+noinst_HEADERS =
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
diff --git a/lib/Makefile.in b/lib/Makefile.in
index a8c82c7..06fd304 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -25,6 +25,7 @@
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --aux-dir=. --macro-prefix=gl alloca alloca-opt atexit closeout dirname error exclude exit exitfail extensions fnmatch fnmatch-gnu fpending getcwd getopt gettext gettext-h havelib inttostr lstat malloc mbchar mbuiter memchr memcpy mempcpy memset obstack pathmax quotearg realloc regex restrict stat-macros stdbool strcase strcspn strdup strnlen1 strpbrk strsep strstr xalloc xalloc-die xgetcwd
+
SOURCES = $(libgnu_a_SOURCES)
srcdir = @srcdir@
@@ -50,18 +51,18 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = lib
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in __fpending.c \
- __fpending.h alloca.c atexit.c closeout.c closeout.h dirname.c \
- dirname.h error.c error.h exclude.c exclude.h exitfail.c \
- exitfail.h fnmatch.c getcwd.c getcwd.h getopt.c getopt1.c \
- imaxtostr.c intprops.h inttostr.c inttostr.h lstat.c lstat.h \
- malloc.c mbchar.c memchr.c memcpy.c mempcpy.c mempcpy.h \
- memset.c obstack.c obstack.h offtostr.c pathmax.h quotearg.c \
- quotearg.h realloc.c regcomp.c regex.c regex.h \
- regex_internal.c regex_internal.h regexec.c stat-macros.h \
- strcasecmp.c strcspn.c strdup.c strdup.h strncasecmp.c \
- strpbrk.c strsep.c strstr.c umaxtostr.c xalloc.h xgetcwd.c \
- xgetcwd.h xmalloc.c
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in __fpending.c __fpending.h alloca.c \
+ atexit.c closeout.c closeout.h dirname.c dirname.h error.c \
+ error.h exclude.c exclude.h exitfail.c exitfail.h fnmatch.c \
+ getcwd.c getcwd.h getopt.c getopt1.c imaxtostr.c intprops.h \
+ inttostr.c inttostr.h lstat.c lstat.h malloc.c mbchar.c \
+ memchr.c memcpy.c mempcpy.c mempcpy.h memset.c obstack.c \
+ obstack.h offtostr.c pathmax.h quotearg.c quotearg.h realloc.c \
+ regcomp.c regex.c regex.h regex_internal.c regex_internal.h \
+ regexec.c stat-macros.h strcasecmp.c strcspn.c strdup.c \
+ strdup.h strncasecmp.c strpbrk.c strsep.c strstr.c umaxtostr.c \
+ xalloc.h xgetcwd.c xgetcwd.h xmalloc.c
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/alloca.m4 \
$(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/closeout.m4 \
@@ -122,6 +123,7 @@ CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libgnu_a_SOURCES)
DIST_SOURCES = $(libgnu_a_SOURCES)
+HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -255,6 +257,7 @@ libgnu_a_SOURCES = basename.c stripslash.c exit.h gettext.h mbchar.h \
mbuiter.h strcase.h strnlen1.h strnlen1.c strpbrk.h strsep.h \
strstr.h verify.h xalloc-die.c
libgnu_a_LIBADD = @LIBOBJS@ @ALLOCA@
+noinst_HEADERS =
EXTRA_DIST = alloca_.h fnmatch_.h fnmatch_loop.c getopt_.h \
getopt_int.h inttostr.c stdbool_.h
BUILT_SOURCES = $(ALLOCA_H) $(FNMATCH_H) $(GETOPT_H) $(STDBOOL_H)
@@ -397,7 +400,7 @@ distdir: $(DISTFILES)
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LIBRARIES) $(HEADERS)
installdirs:
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index 2c5b129..c5a4e40 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c
index 3094a17..2b5897c 100644
--- a/lib/fnmatch_loop.c
+++ b/lib/fnmatch_loop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -1188,5 +1188,5 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
#undef STRCOLL
#undef STRLEN
#undef STRCAT
-#undef L
+#undef L_
#undef BTOWC
diff --git a/lib/getopt.c b/lib/getopt.c
index bcb81c8..83bd6db 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -2,7 +2,7 @@
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
- Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004
+ Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,28 +20,16 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include <stdio.h>
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-# include <stdlib.h>
-# include <unistd.h>
-#endif /* GNU C library. */
+#include "getopt.h"
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#ifdef VMS
# include <unixlib.h>
@@ -76,7 +64,6 @@
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
-#include "getopt.h"
#include "getopt_int.h"
/* For communication from `getopt' to the caller.
@@ -118,16 +105,9 @@ int optopt = '?';
static struct _getopt_data getopt_data;
-#ifndef __GNU_LIBRARY__
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-#ifndef getenv
+#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV
extern char *getenv ();
#endif
-
-#endif /* not __GNU_LIBRARY__ */
#ifdef _LIBC
/* Stored original parameters.
@@ -556,10 +536,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -634,10 +611,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -674,10 +648,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -751,10 +722,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -817,10 +785,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -868,10 +833,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -940,10 +902,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -985,10 +944,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -1027,10 +983,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
@@ -1101,10 +1054,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ __fxprintf (NULL, "%s", buf);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 1d1b543..113239f 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -1,7 +1,7 @@
/* quotearg.c - quote arguments for output
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software
- Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 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
@@ -307,6 +307,9 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
STORE ('\\');
STORE ('?');
break;
+
+ default:
+ break;
}
break;
@@ -454,6 +457,9 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
case '[': case '\\': case '^':
case '`': case '|':
goto use_shell_always_quoting_style;
+
+ default:
+ break;
}
}
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index d10ba1e..04be143 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -182,10 +182,9 @@ typedef unsigned long int bitset_word;
# if BITSET_WORD_BITS <= SBC_MAX
# error "Invalid SBC_MAX"
# endif
-#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff
-/* Work around a bug in PGC GNU/Linux x86-64 5.2-1 and 6.0-8 (and
- probably other versions), where the preprocessor mishandles large
- unsigned values and thinks they are signed. */
+ #elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff
+/* Work around a bug in 64-bit PGC (before version 6.1-2), where the
+ preprocessor mishandles large unsigned values as if they were signed. */
# define BITSET_WORD_BITS 64
#else
# error "Add case for new bitset_word size"
diff --git a/lib/stdbool_.h b/lib/stdbool_.h
index 3177ae0..efa80ba 100644
--- a/lib/stdbool_.h
+++ b/lib/stdbool_.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -70,18 +70,40 @@
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
(see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
enum; this ensures that '_Bool' promotes to 'int'. */
-#if !(defined __cplusplus || defined __BEOS__)
+#if defined __cplusplus || defined __BEOS__
+ /* A compiler known to have 'bool'. */
+ /* If the compiler already has both 'bool' and '_Bool', we can assume they
+ are the same types. */
# if !@HAVE__BOOL@
-# if defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1)
- /* Avoid stupid "warning: _Bool is a keyword in ISO C99". */
-# define _Bool signed char
+typedef bool _Bool;
+# endif
+#else
+# if !defined __GNUC__
+ /* If @HAVE__BOOL@:
+ Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
+ the built-in _Bool type is used. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+ Similar bugs are likely with other compilers as well; this file
+ wouldn't be used if <stdbool.h> was working.
+ So we override the _Bool type.
+ If !@HAVE__BOOL@:
+ Need to define _Bool ourselves. As 'signed char' or as an enum type?
+ Use of a typedef, with SunPRO C, leads to a stupid
+ "warning: _Bool is a keyword in ISO C99".
+ Use of an enum type, with IRIX cc, leads to a stupid
+ "warning(1185): enumerated type mixed with another type".
+ The only benefit of the enum type, debuggability, is not important
+ with these compilers. So use 'signed char' and no typedef. */
+# define _Bool signed char
enum { false = 0, true = 1 };
-# else
+# else
+ /* With this compiler, trust the _Bool type if the compiler has it. */
+# if !@HAVE__BOOL@
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
# endif
# endif
-#else
-typedef bool _Bool;
#endif
#define bool _Bool