|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
[PATCH 0/4] RRI patches, and remove Makefile.bootHere are the patches I committed based on Aharon's.
Aharon Robbins (2): dfa: include stdbool.h explicitly dfa: do not use strcoll to match multibyte characters in ranges Paolo Bonzini (2): drop support for Makefile.boot dfa: do not use hard-locale Makefile.am | 2 - Makefile.boot | 156 -------------------------------------------------------- NEWS | 4 ++ README-alpha | 3 +- README-boot | 16 ------ bootstrap.conf | 1 - src/dfa.c | 47 ++++++----------- 7 files changed, 21 insertions(+), 208 deletions(-) delete mode 100644 Makefile.boot delete mode 100644 README-boot -- 1.7.9.3 |
|
|
[PATCH 1/4] dfa: include stdbool.h explicitlyFrom: Aharon Robbins <arnold@...>
* src/dfa.c: Include stdbool.h explicitly --- src/dfa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dfa.c b/src/dfa.c index 1cbe537..b7b8e02 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -29,6 +29,7 @@ #include <limits.h> #include <string.h> #include <locale.h> +#include <stdbool.h> #define STREQ(a, b) (strcmp (a, b) == 0) -- 1.7.9.3 |
|
|
[PATCH 2/4] dfa: do not use strcoll to match multibyte characters in rangesFrom: Aharon Robbins <arnold@...>
This does not affect the behavior of grep, which always defers to glibc or gnulib when matching ranges. * src/dfa.c (match_mb_charset): Compare wc directly to the range endpoints. --- src/dfa.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/dfa.c b/src/dfa.c index b7b8e02..39ca604 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -2967,7 +2967,6 @@ match_mb_charset (struct dfa *d, state_num s, position pos, size_t idx) with which this operator match. */ int op_len; /* Length of the operator. */ char buffer[128]; - wchar_t wcbuf[6]; /* Pointer to the structure to which we are currently referring. */ struct mb_char_classes *work_mbc; @@ -3040,16 +3039,11 @@ match_mb_charset (struct dfa *d, state_num s, position pos, size_t idx) } } - wcbuf[0] = wc; - wcbuf[1] = wcbuf[3] = wcbuf[5] = '\0'; - /* match with a range? */ for (i = 0; i < work_mbc->nranges; i++) { - wcbuf[2] = work_mbc->range_sts[i]; - wcbuf[4] = work_mbc->range_ends[i]; - - if (wcscoll (wcbuf, wcbuf + 2) >= 0 && wcscoll (wcbuf + 4, wcbuf) >= 0) + if (work_mbc->range_sts[i] <= wc && + wc <= work_mbc->range_ends[i]) goto charset_matched; } -- 1.7.9.3 |
|
|
[PATCH 3/4] drop support for Makefile.boot* Makefile.am: Do not distribute README-boot and Makefile.boot.
* NEWS: Mention this change. * README-alpha: Do not mention README-boot and Makefile.boot. * Makefile.boot: Remove. * README-boot: Remove. --- Makefile.am | 2 - Makefile.boot | 156 --------------------------------------------------------- NEWS | 4 ++ README-alpha | 3 +- README-boot | 16 ------ 5 files changed, 5 insertions(+), 176 deletions(-) delete mode 100644 Makefile.boot delete mode 100644 README-boot diff --git a/Makefile.am b/Makefile.am index 786bf5e..954d3ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,10 +22,8 @@ SUBDIRS = po lib doc src tests gnulib-tests EXTRA_DIST = \ ChangeLog-2009 \ - Makefile.boot \ README \ README-alpha \ - README-boot \ TODO \ cfg.mk diff --git a/Makefile.boot b/Makefile.boot deleted file mode 100644 index 4414110..0000000 --- a/Makefile.boot +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright 1997-1998, 2005-2012 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, see <http://www.gnu.org/licenses/>. - -# Define for DOS/WIN (not including DJGPP): -#OBJEXT = obj -#EXEEXT = .exe -EXEEXT = -OBJEXT = o - -# Source of grep. -grep_OBJS = \ - grep.$(OBJEXT) \ - search.$(OBJEXT) \ - kwset.$(OBJEXT) \ - dfa.$(OBJEXT) -egrep_OBJS = \ - egrep.$(OBJEXT) \ - esearch.$(OBJEXT) \ - kwset.$(OBJEXT) \ - dfa.$(OBJEXT) -fgrep_OBJS = \ - fgrep.$(OBJEXT) \ - fsearch.$(OBJEXT) \ - kwset.$(OBJEXT) - -# Supporting routines. -LIB_OBJS_core = \ - $(libdir)/closeout.$(OBJEXT) \ - $(libdir)/error.$(OBJEXT) \ - $(libdir)/exclude.$(OBJEXT) \ - $(libdir)/hard-locale.$(OBJEXT) \ - $(libdir)/quotearg.$(OBJEXT) \ - $(libdir)/regex.$(OBJEXT) \ - $(libdir)/strtoumax.$(OBJEXT) \ - $(libdir)/xmalloc.$(OBJEXT) \ - $(libdir)/xstrtol.$(OBJEXT) \ - $(libdir)/xstrtoumax.$(OBJEXT) - -# Comment out functions already supported as needed. -#LIB_OBJ_atexit = $(libdir)/atexit.$(OBJEXT) -#LIB_OBJ_alloca = $(libdir)/alloca.$(OBJEXT) -#LIB_OBJ_fnmatch = $(libdir)/fnmatch.$(OBJEXT) -LIB_OBJ_getopt = $(libdir)/getopt.$(OBJEXT) $(libdir)/getopt1.$(OBJEXT) -#LIB_OBJ_memchr = $(libdir)/memchr.$(OBJEXT) -LIB_OBJ_obstack = $(libdir)/obstack.$(OBJEXT) -#LIB_OBJ_strtoul = $(libdir)/strtoul.$(OBJEXT) - -LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_atexit) $(LIB_OBJ_alloca) \ - $(LIB_OBJ_fnmatch) $(LIB_OBJ_getopt) $(LIB_OBJ_memchr) \ - $(LIB_OBJ_obstack) $(LIB_OBJ_strtoul) - -# For Linux -#LIB_OBJS = $(LIB_OBJS_core) - -# For QNX/Neutrino -#LIB_OBJS = $(LIB_OBJS_core) $(LIB_OBJ_getopt) $(LIB_OBJ_obstack) - -# Where is DIR and opendir/readdir defined. -# or -DHAVE_DIRENT_H -# or -DHAVE_SYS_NDIR_H -# or -DHAVE_SYS_DIR_H -# or -DHAVE_NDIR_H -# -# undef HAVE_STRERROR if lacking strerror() -# undef HAVE_MEMCHR if lacking memchr() -# - -# default dry run -DEFS_core = \ - -DSTDC_HEADERS \ - -DHAVE_MEMCHR \ - -DHAVE_DIRENT_H \ - -DHAVE_STRERROR \ - -Dconst= \ - -Duintmax_t=long - -# SunOS-4.1.x k&r cc -#DEFS_sunos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -Dconst= - -# Solaris -#DEFS_solaris = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -DHAVE_STRERROR - -# DOS/WIN (change also OBJEXT/EXEEXT, see above) -# DOS/DJGPP -DEFS_dos = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_DIRENT_H \ - -DHAVE_DOS_FILE_CONTENTS \ - -DHAVE_DOS_FILE_NAMES -DHAVE_UNISTD_H -DHAVE_SETMODE - -# If support ANSI C prototypes -DEFS_ansi_c = -DPROTOTYPES - -# No wchar support -# DEFS_wchar = -DUSE_WIDE_CHAR -DHAVE_WCHAR_H -# DEFS_wchar = -Dwchar_t=int -Dmbstate_t=int -DEFS_wchar = -DHAVE_WCHAR_H - -# Are strtol() and strtoul() declared? -#DEFS_strtol = -DHAVE_DECL_STRTOULL=0 -DHAVE_DECL_STRTOUL=0 -DEFS_strtol = -DHAVE_DECL_STRTOULL=1 -DHAVE_DECL_STRTOUL=1 - -# Define if malloc(0)/realloc(0) works -#DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=0 \ -# -DHAVE_DONE_WORKING_REALLOC_CHECK=0 -DEFS_alloc = -DHAVE_DONE_WORKING_MALLOC_CHECK=1 \ - -DHAVE_DONE_WORKING_REALLOC_CHECK=1 - -DEFS = $(DEFS_core) $(DEFS_ansi_c) $(DEFS_wchar) $(DEFS_strtol) $(DEFS_alloc) \ - -DHAVE_DECL_STRERROR_R=1 -DHAVE_VPRINTF -DCHAR_BIT=8 \ - -DSTDOUT_FILENO=1 - - -#### - -CFLAGS = $(DEFS) -I. -I.. -I$(libdir) \ - -DVERSION=\"bootstrap\" -DPACKAGE=\"grep\" \ - -DPACKAGE_STRING=\"grep\ bootstrap\" \ - -DPACKAGE_BUGREPORT=\"bug-grep@...\" - -libdir = ../lib - -PROGS = grep$(EXEEXT) egrep$(EXEEXT) fgrep$(EXEEXT) - -libgreputils_a = $(libdir)/libgreputils.a - -all : $(libgreputils_a) $(PROGS) - -grep$(EXEEXT) : $(grep_OBJS) $(libgreputils_a) - $(CC) $(grep_OBJS) -o grep $(libgreputils_a) - -egrep$(EXEEXT) : $(egrep_OBJS) $(libgreputils_a) - $(CC) $(egrep_OBJS) -o egrep $(libgreputils_a) - -fgrep$(EXEEXT) : $(fgrep_OBJS) $(libgreputils_a) - $(CC) $(fgrep_OBJS) -o fgrep $(libgreputils_a) - -$(libgreputils_a) : $(LIB_OBJS) - $(AR) $(ARFLAGS) $(libgreputils_a) $(LIB_OBJS) - -clean : - $(RM) grep.$(OBJEXT) egrep.$(OBJEXT) fgrep.$(OBJEXT) - $(RM) search.$(OBJEXT) esearch.$(OBJEXT) fsearch.$(OBJEXT) - $(RM) kwset.$(OBJEXT) dfa.$(OBJEXT) - $(RM) $(PROGS) - $(RM) $(libgreputils_a) $(LIB_OBJS) diff --git a/NEWS b/NEWS index e26eafc..eb77919 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ GNU grep NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Dropped features + + Bootstrapping with Makefile.boot has been broken since grep 2.6, + and was removed. * Noteworthy changes in release 2.12 (2012-04-23) [stable] diff --git a/README-alpha b/README-alpha index 5334627..5b25a18 100644 --- a/README-alpha +++ b/README-alpha @@ -10,8 +10,7 @@ The development source code is available via Git from Savannah: see The source code in the Git uses autotools to generate some files. Before following the instructions in the INSTALL file for compiling grep, you -need to run the bootstrap script. If you don't have the autotools -installed on your system, see README-boot. +need to run the bootstrap script. Test releases are available at <http://alpha.gnu.org/gnu/grep/>. diff --git a/README-boot b/README-boot deleted file mode 100644 index 88bead7..0000000 --- a/README-boot +++ /dev/null @@ -1,16 +0,0 @@ - Copyright (C) 1992, 1997-2002, 2004-2012 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, - are permitted in any medium without royalty provided the copyright - notice and this notice are preserved. - -If your system is lacking the necessary tools to build the configuration, -Makefile.boot is provided for bootstrapping. Invoke it with the following -command: - - (cd src && make -f ../Makefile.boot) - -Indications on how to tweak Makefile.boot for different systems are -provided in the file itself. - -Good luck! -- 1.7.9.3 |
|
|
[PATCH 4/4] dfa: do not use hard-locale* bootstrap.conf (gnulib_modules): Remove hard-locale.
* src/dfa.c (hard_LC_COLLATE): Remove. (dfaparse): Do not initialize it. (parse_bracket_exp): Always go through system regex matcher to find single byte characters matching a range. --- bootstrap.conf | 1 - src/dfa.c | 36 +++++++++++++----------------------- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 8c9270c..a7853c9 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -42,7 +42,6 @@ git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload -hard-locale ignore-value intprops inttypes diff --git a/src/dfa.c b/src/dfa.c index 39ca604..eefc817 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -57,7 +57,6 @@ #include "regex.h" #include "dfa.h" -#include "hard-locale.h" #include "xalloc.h" /* HPUX, define those as macros in sys/param.h */ @@ -778,7 +777,6 @@ static int laststart; /* True if we're separated from beginning or (, only by zero-width characters. */ static size_t parens; /* Count of outstanding left parens. */ static int minrep, maxrep; /* Repeat counts for {m,n}. */ -static int hard_LC_COLLATE; /* Nonzero if LC_COLLATE is hard. */ static int cur_mb_len = 1; /* Length of the multibyte representation of wctok. */ @@ -1112,26 +1110,21 @@ parse_bracket_exp (void) c1 = tolower (c1); c2 = tolower (c2); } - if (!hard_LC_COLLATE) - for (c = c1; c <= c2; c++) - setbit_case_fold_c (c, ccl); - else + + /* Defer to the system regex library about the meaning + of range expressions. */ + regex_t re; + char pattern[6] = { '[', c1, '-', c2, ']', 0 }; + char subject[2] = { 0, 0 }; + regcomp (&re, pattern, REG_NOSUB); + for (c = 0; c < NOTCHAR; ++c) { - /* Defer to the system regex library about the meaning - of range expressions. */ - regex_t re; - char pattern[6] = { '[', c1, '-', c2, ']', 0 }; - char subject[2] = { 0, 0 }; - regcomp (&re, pattern, REG_NOSUB); - for (c = 0; c < NOTCHAR; ++c) - { - subject[0] = c; - if (!(case_fold && isupper (c)) - && regexec (&re, subject, 0, NULL, 0) != REG_NOMATCH) - setbit_case_fold_c (c, ccl); - } - regfree (&re); + subject[0] = c; + if (!(case_fold && isupper (c)) + && regexec (&re, subject, 0, NULL, 0) != REG_NOMATCH) + setbit_case_fold_c (c, ccl); } + regfree (&re); } colon_warning_state |= 8; @@ -1879,9 +1872,6 @@ dfaparse (char const *s, size_t len, struct dfa *d) lasttok = END; laststart = 1; parens = 0; -#ifdef LC_COLLATE - hard_LC_COLLATE = hard_locale (LC_COLLATE); -#endif if (MB_CUR_MAX > 1) { cur_mb_len = 0; -- 1.7.9.3 |
|
|
|
|
|
Re: [PATCH 4/4] dfa: do not use hard-localeIl 30/04/2012 07:46, arnold@... ha scritto:
> Hi Paolo. > > It looks like in this patch you have declarations after executable code. > I thought Jim agreed earlier that for dfa.c it'd be OK to be C89 compatible > and have all declarations before code; I need this for at least one > platform I support. Okay, I wasn't sure about the situation here. I'll fix it. Paolo |
| Free embeddable forum powered by Nabble | Forum Help |