aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-04-03 16:31:49 +0000
committerRoland McGrath <roland@gnu.org>1996-04-03 16:31:49 +0000
commit299a95b9f048679f1288512b0a6ab6ca16dd9d7c (patch)
tree4788a62ee8f131887e5817e8daa3339084dbe764
parent30de3b18a526acc837957865129b7fa6d8ac91d1 (diff)
downloadglibc-299a95b9f048679f1288512b0a6ab6ca16dd9d7c.tar.xz
glibc-299a95b9f048679f1288512b0a6ab6ca16dd9d7c.zip
Tue Apr 2 21:27:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/glob.c (glob_pattern_p): Avoid scanning past eos if the pattern ends with a backslash and quoting is enabled. * posix/fnmatch.c (fnmatch): Likewise; return FNM_NOMATCH for such patterns.
-rw-r--r--ChangeLog7
-rw-r--r--MakeTAGS4
-rw-r--r--Makerules4
-rw-r--r--locale/Makefile5
-rw-r--r--locale/programs/config.h3
-rw-r--r--locale/programs/ctypedump.c163
-rw-r--r--locale/programs/locale.c188
-rw-r--r--po/header.pot14
-rw-r--r--posix/fnmatch.c17
-rw-r--r--posix/glob.c2
-rw-r--r--setjmp/setjmp.h2
-rw-r--r--stdio-common/_itoa.c6
-rw-r--r--stdio-common/_itoa.h29
-rw-r--r--stdio-common/printf-parse.h135
-rw-r--r--stdio-common/printf-prs.c52
-rw-r--r--stdio-common/printf.h9
-rw-r--r--stdio-common/tst-printf.c17
-rw-r--r--stdio-common/vfprintf.c1710
-rw-r--r--stdlib/strtod.c20
-rw-r--r--sysdeps/generic/setenv.c5
-rw-r--r--wcsmbs/Makefile11
-rw-r--r--wcsmbs/mbsadvance.c38
-rw-r--r--wcsmbs/mbscat.c56
-rw-r--r--wcsmbs/mbschr.c60
-rw-r--r--wcsmbs/mbscpy.c47
-rw-r--r--wcsmbs/mbsdup.c51
-rw-r--r--wcsmbs/mbslen.c45
-rw-r--r--wcsmbs/mbsncat.c61
-rw-r--r--wcsmbs/mbsncmp.c68
-rw-r--r--wcsmbs/mbsncpy.c55
-rw-r--r--wcsmbs/mbsrchr.c61
-rw-r--r--wcsmbs/mbstomb.c42
-rw-r--r--wcsmbs/mbstr.h69
-rw-r--r--wcsmbs/wcscat.c9
-rw-r--r--wcsmbs/wcschr.c8
-rw-r--r--wcsmbs/wcscmp.c11
-rw-r--r--wcsmbs/wcscpy.c9
-rw-r--r--wcsmbs/wcscspn.c9
-rw-r--r--wcsmbs/wcsdup.c7
-rw-r--r--wcsmbs/wcslen.c7
-rw-r--r--wcsmbs/wcsncat.c11
-rw-r--r--wcsmbs/wcsncmp.c11
-rw-r--r--wcsmbs/wcsncpy.c13
-rw-r--r--wcsmbs/wcspbrk.c9
-rw-r--r--wcsmbs/wcsrchr.c9
-rw-r--r--wcsmbs/wcsspn.c9
-rw-r--r--wcsmbs/wcstok.c43
-rw-r--r--wcsmbs/wcstr.h84
-rw-r--r--wcsmbs/wcswcs.c97
49 files changed, 1507 insertions, 1895 deletions
diff --git a/ChangeLog b/ChangeLog
index f8c952fa76..ac276db283 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Apr 2 21:27:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * posix/glob.c (glob_pattern_p): Avoid scanning past eos if
+ the pattern ends with a backslash and quoting is enabled.
+ * posix/fnmatch.c (fnmatch): Likewise; return FNM_NOMATCH for such
+ patterns.
+
Mon Apr 1 13:34:55 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* stdio-common/tst-printf.c (main): Add new test case.
diff --git a/MakeTAGS b/MakeTAGS
index a9baba65e8..7aaf0ac7da 100644
--- a/MakeTAGS
+++ b/MakeTAGS
@@ -165,7 +165,9 @@ $P/subdirs.pot: $(subdirs:%=$P/%.pot)
# Combine all the messages into the final sorted template translation file.
$P/SYS_libc.pot: $(all-pot)
@rm -f $@.new
- $(XGETTEXT) -d - -n -s --omit-header $^ > $@.new
+ sed -e 's/VERSION/$(version)/' -e "s/DATE/`date +'%Y-%m-%d %k:%M'`" \
+ po/header.pot > $@.new
+ $(XGETTEXT) -d - -n -s --omit-header $^ >> $@.new
mv -f $@.new $@
test ! -d CVS || cvs ci -m'Regenerated from source files' $@
diff --git a/Makerules b/Makerules
index 296e811432..d7e82d9082 100644
--- a/Makerules
+++ b/Makerules
@@ -610,8 +610,12 @@ cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=%) -o $(@F)
endef
# We always want to use configuration definitions.
+ifdef objdir
# This is always used in $(common-objdir), so we use no directory name.
BUILD_CFLAGS = -include config.h
+else
+BUILD_CFLAGS = -include $(..)config.h
+endif
# Support the GNU standard name for this target.
.PHONY: check
diff --git a/locale/Makefile b/locale/Makefile
index 675052aa03..0a30cd27d3 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -31,8 +31,8 @@ distribute = localeinfo.h categories.def \
routines = setlocale loadlocale localeconv nl_langinfo
categories = ctype messages monetary numeric time collate
aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc
-others = localedef# locale
-install-bin = localedef# locale
+others = localedef locale
+install-bin = localedef locale
extra-objs = $(localedef-modules:=.o) $(locale-modules:=.o) \
$(lib-modules:=.o)
@@ -41,7 +41,6 @@ vpath %.h programs
localedef-modules := $(categories:%=ld-%) charmap charset linereader \
locfile stringtrans
-locale-modules := ctypedump
lib-modules := simple-hash xmalloc xstrdup
diff --git a/locale/programs/config.h b/locale/programs/config.h
index 64054657cb..4aa406d755 100644
--- a/locale/programs/config.h
+++ b/locale/programs/config.h
@@ -27,7 +27,6 @@ typedef int wint_t;
typedef unsigned short int u16_t;
-
-int euidaccess (__const char *__name, int __type);
+#include_next <config.h>
#endif
diff --git a/locale/programs/ctypedump.c b/locale/programs/ctypedump.c
deleted file mode 100644
index 2a6753495e..0000000000
--- a/locale/programs/ctypedump.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-#include <ctype.h>
-#include <endian.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <netinet/in.h> /* Just for htons() */
-
-/*#include "localedef.h"*/
-#include "localeinfo.h"
-
-
-/* FIXME: these values should be part of the LC_CTYPE information. */
-#define mb_cur_max 1
-#define mb_cur_min 1
-
-
-#define SWAP32(v) \
- ((u32_t) (((((u32_t) (v)) & 0x000000ff) << 24) \
- | ((((u32_t) (v)) & 0x0000ff00) << 8) \
- | ((((u32_t) (v)) & 0x00ff0000) >> 8) \
- | ((((u32_t) (v)) & 0xff000000) >> 24)))
-
-
-
-static inline void
-print_short_in_char (unsigned short val)
-{
- const unsigned char *p = (const unsigned char *) &val;
- printf ("\"\\%03o\\%03o\"", p[0], p[1]);
-}
-
-
-static inline void
-print_int_in_char (unsigned int val)
-{
- const unsigned char *p = (const unsigned char *) &val;
- printf ("\"\\%03o\\%03o\\%03o\\%03o\"", p[0], p[1], p[2], p[3]);
-}
-
-
-int
-ctype_output (void)
-{
- int ch;
- int result = 0;
- const char *locname = (getenv ("LC_ALL") ?: getenv ("LC_CTYPE") ?:
- getenv ("LANG") ?: "POSIX");
-
- puts ("#include <endian.h>\n");
-
- if (mb_cur_max == 1)
- {
- printf ("const char _nl_%s_LC_CTYPE_class[] = \n", locname);
- for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
- {
- if (((ch + 128) % 6) == 0)
- printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
- print_short_in_char (htons (__ctype_b [ch < 0 ? 256 + ch : ch]));
- fputc (((ch + 128) % 6) == 5 ? '\n' : ' ', stdout);
- }
- puts (";");
- }
-
- printf ("#if BYTE_ORDER == %s\n",
- BYTE_ORDER == LITTLE_ENDIAN ? "LITTLE_ENDIAN" : "BIG_ENDIAN");
-
- if (mb_cur_max == 1)
- {
- printf ("const char _nl_%s_LC_CTYPE_toupper[] = \n", locname);
- for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
- {
- if (((ch + 128) % 3) == 0)
- printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
- print_int_in_char (__ctype_toupper[ch < 0 ? 256 + ch : ch]);
- fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
- }
- puts (";");
-
- printf ("const char _nl_%s_LC_CTYPE_tolower[] = \n", locname);
- for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
- {
- if (((ch + 128) % 3) == 0)
- printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
- print_int_in_char (__ctype_tolower[ch < 0 ? 256 + ch : ch]);
- fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
- }
- puts (";");
- }
- else
- /* not implemented */;
-
- printf ("#elif BYTE_ORDER == %s\n",
- BYTE_ORDER == LITTLE_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN");
-
- if (mb_cur_max == 1)
- {
- printf ("const char _nl_%s_LC_CTYPE_toupper[] = \n", locname);
- for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
- {
- if (((ch + 128) % 3) == 0)
- printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
- print_int_in_char (SWAP32 (__ctype_toupper[ch < 0 ? 256 + ch : ch]));
- fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
- }
- puts (";");
-
- printf ("const char _nl_%s_LC_CTYPE_tolower[] = \n", locname);
- for (ch = -128; ch < (1 << (8 * MB_CUR_MAX)); ++ch)
- {
- if (((ch + 128) % 3) == 0)
- printf (" /* 0x%02x */ ", ch < 0 ? 256 + ch : ch);
- print_int_in_char (SWAP32 (__ctype_tolower[ch < 0 ? 256 + ch : ch]));
- fputc (((ch + 128) % 3) == 2 ? '\n' : ' ', stdout);
- }
- puts (";");
- }
- else
- /* not implemented */;
-
- puts ("#else\n#error \"BYTE_ORDER\" BYTE_ORDER \" not handled.\"\n#endif\n");
-
- printf("const struct locale_data _nl_%s_LC_CTYPE = \n\
-{\n\
- NULL, 0, /* no file mapped */\n\
- 5,\n\
- {\n\
- _nl_C_LC_CTYPE_class,\n\
-#ifdef BYTE_ORDER == LITTLE_ENDIAN\n\
- NULL, NULL,\n\
-#endif\n\
- _nl_C_LC_CTYPE_toupper,\n\
- _nl_C_LC_CTYPE_tolower,\n\
-#ifdef BYTE_ORDER == BIG_ENDIAN\n\
- NULL, NULL,\n\
-#endif\n\
- }\n\
-};\n", locname);
-
- return result;
-}
-
-/*
- * Local Variables:
- * mode:c
- * c-basic-offset:2
- * End:
- */
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 4e4ff83a37..8254289598 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -15,7 +15,12 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <dirent.h>
+#include <error.h>
#include <getopt.h>
#include <langinfo.h>
#include <libintl.h>
@@ -26,13 +31,9 @@ Cambridge, MA 02139, USA. */
#include <unistd.h>
#include <errno.h>
-/*#include "localedef.h"*/
#include "localeinfo.h"
-/* If set dump C code describing the current locale. */
-static int do_dump;
-
/* If set print the name of the category. */
static int show_category_name;
@@ -45,7 +46,6 @@ static const struct option long_options[] =
{ "all-locales", no_argument, NULL, 'a' },
{ "category-name", no_argument, &show_category_name, 1 },
{ "charmaps", no_argument, NULL, 'm' },
- { "dump", no_argument, &do_dump, 1 },
{ "help", no_argument, NULL, 'h' },
{ "keyword-name", no_argument, &show_keyword_name, 1 },
{ "version", no_argument, NULL, 'v' },
@@ -65,35 +65,48 @@ static const struct option long_options[] =
#define CTYPE_TOUPPER_EL 0
#define CTYPE_TOLOWER_EL 0
-/* XXX Hack */
-struct cat_item
+/* Definition of the data structure which represents a category and its
+ items. */
+struct category
{
- int item_id;
+ int cat_id;
const char *name;
- enum { std, opt } status;
- enum value_type value_type;
- int min;
- int max;
+ size_t number;
+ struct cat_item
+ {
+ int item_id;
+ const char *name;
+ enum { std, opt } status;
+ enum value_type value_type;
+ int min;
+ int max;
+ } *item_desc;
};
+/* Simple helper macro. */
+#define NELEMS(arr) ((sizeof (arr)) / (sizeof (arr[0])))
+
+/* For some tricky stuff. */
+#define NO_PAREN(Item, More...) Item, ## More
/* We have all categories defined in `categories.def'. Now construct
the description and data structure used for all categories. */
+#define DEFINE_ELEMENT(Item, More...) { Item, ## More },
#define DEFINE_CATEGORY(category, name, items, postload, in, check, out) \
static struct cat_item category##_desc[] = \
{ \
NO_PAREN items \
};
-#include "locale/aux/categories.def"
+#include "categories.def"
#undef DEFINE_CATEGORY
static struct category category[] =
{
#define DEFINE_CATEGORY(category, name, items, postload, in, check, out) \
{ _NL_NUM_##category, name, NELEMS (category##_desc) - 1, \
- cat