64 Commits
Author SHA1 Message Date
Paolo Bonzini 44536f208a bump version number to 4.1.5
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-63
v4.1.5
2008-01-09 16:12:04 +01:00
Paolo Bonzini 1ca31d6728 fix y/[/X/ and add more testcases for the y command
2006-02-03  Paolo Bonzini  <bonzini@gnu.org>

	* sed/compile.c (compile_program) <case 'y'>: Pass false to match_slash.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-62
2008-01-09 16:12:04 +01:00
Paolo Bonzini ef1ea7f8bb add install_sh definition to intl/po
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-61
2008-01-09 16:12:03 +01:00
Paolo Bonzini de400b3b34 fix `turn filenames into lowercase' example
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-60
2008-01-09 16:12:02 +01:00
Paolo Bonzini 811c3446c6 merge with glibc regex
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-59
2008-01-09 16:12:01 +01:00
Paolo Bonzini a8485beddc fix sed faq address
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-58
2008-01-09 16:12:00 +01:00
Paolo Bonzini 6cf9fe5b1b add LANG_SORBIAN and other mingw fixes
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-57
2008-01-09 16:11:59 +01:00
Paolo Bonzini 6d02437ad8 fix typo in docs/Makefile.am
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-56
2008-01-09 16:11:58 +01:00
Paolo Bonzini 34b6da2799 remove RCS markers
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-55
2008-01-09 16:11:58 +01:00
Paolo Bonzini 912c1770ac update regex from upstream
2005-09-07  Paolo Bonzini  <bonzini@gnu.org>

	* lib/regcomp.c: Update from upstream.
	* lib/regex.c: Update from upstream.
	* lib/regex_.h: Update from upstream.
	* lib/regex_internal.c: Update from upstream.
	* lib/regex_internal.h: Update from upstream.
	* lib/regexec.c: Update from upstream.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-54
2008-01-09 16:11:57 +01:00
Paolo Bonzini d6bda34b13 provide a better name for the man page
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-53
2008-01-09 16:11:56 +01:00
Paolo Bonzini 9015803ab0 fix 0~2, signaled by Guglielmo Bondioni
2005-08-30  Paolo Bonzini  <bonzini@gnu.org>

	* sed/execute.c (reset_addresses): Never activate ADDR_IS_NUM_MOD
	addresses.
	* testsuite/modulo.good, testsuite/modulo.inp, testsuite/modulo.sed:
	New.
	* testsuite/Makefile.tests: Add new testcase.
	* testsuite/Makefile.am: Add new testcase.
	* testsuite/Makefile.in: Regenerate.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-52
2008-01-09 16:11:55 +01:00
Paolo Bonzini bdbfe6d711 merge regex with glibc and adjust doc/.arch-inventory
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-51
2008-01-09 16:11:54 +01:00
Paolo Bonzini 584e5cedc2 more updates to the FSF address
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-50
2008-01-09 16:11:53 +01:00
Paolo Bonzini 07e543c45f update FSF address
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-49
2008-01-09 16:11:52 +01:00
Paolo Bonzini 72edd0eea0 add cache variable for -lcP test
2005-05-18  Maciej W. Rozycki  <macro@linux-mips.org>

	* configure.ac: Use a cache variable for the libcP test.
	* configure: Regenerate.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-48
2008-01-09 16:11:51 +01:00
Paolo Bonzini d3f8e118d5 fix handling of [^]xyz]
2005-05-16  Eero Hakkinen  <eero17@bigfoot.com>

	* sed/compile.c (snarf_char_class): Fix handling of
	[^]xyz].

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-47
2008-01-09 16:11:51 +01:00
Paolo Bonzini 480bc129c1 update PO files from translation project
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-46
2008-01-09 16:11:50 +01:00
Paolo Bonzini f7eed06223 do not add a default command-line in in-place editing mode
2005-04-11  Paolo Bonzini  <bonzini@gnu.org>

	* sed/execute.c (process_files): Do not add a default
	command-line in in-place editing mode.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-45
2008-01-09 16:11:49 +01:00
Paolo Bonzini 479184e226 fix a/r/R commands when q is encountered
2005-02-10  Paolo Bonzini  <bonzini@gnu.org>

	* testsuite/appquit.good, testsuite/appquit.inp,
	testsuite/appquit.sed: New testcase.
	* testsuite/readin.sed: Quit after the last r command.
	* testsuite/readin.good: Adjust.
	* sed/execute.c (execute_program): Dump the results of the
	a/r/R commands just before quitting.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-44
2008-01-09 16:11:49 +01:00
Paolo Bonzini 20a67b75e7 fix crash on /\(\)/x
2005-02-10  Paolo Bonzini  <bonzini@gnu.org>

	* lib/regcomp.c (lower_subexp): Do not optimize empty
	subexpressions even with REG_NOSUB.
	* testsuite/SPENCER.tests: Add a previously failing testcase.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-43
2008-01-09 16:11:48 +01:00
Paolo Bonzini 93f1e336c3 fix debian bug 294339
2005-02-10  Paolo Bonzini  <bonzini@gnu.org>

	* sed/regexp.c: Fix off-by-one error in the "invalid reference
	to subexpression" message.  Debian bug 294339.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-42
2008-01-09 16:11:47 +01:00
Paolo Bonzini cf7d4aadd2 include config.h from within obstack.h
2005-02-08  Paolo Bonzini  <bonzini@gnu.org>

	* lib/obstack.h: include config.h.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-41
2008-01-09 16:11:46 +01:00
Paolo Bonzini a790e364e0 add Ulrich Drepper to the THANKS file
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-40
2008-01-09 16:11:46 +01:00
Paolo Bonzini 911678b24e make --enable-html enable building .html files, not just installing
2005-02-01  Paolo Bonzini  <bonzini@gnu.org>

	* doc/Makefile.am: Don't enable MAKEINFO_HTML and TEXI2HTML_HTML
	rules unless BUILD_HTML.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-39
2008-01-09 16:11:45 +01:00
Paolo Bonzini 5b8a413620 finally resync with glibc
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-38
2008-01-09 16:11:44 +01:00
Paolo Bonzini f6330a3c93 finishing touches :-) for 4.1.4
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-37
2008-01-09 16:11:43 +01:00
Paolo Bonzini 87cdf72890 fix meaning of \B
2005-01-26  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regcomp.c (peek_token): Fix ctx_type for \B.
	(parse_expression): Lower token->opr.ctx_type == NOT_WORD_DELIM.
 	* posix/regex_internal.h (re_context_type): Add NOT_WORD_DELIM
	and OUTSIDE_WORD.
	* posix/PCRE.tests: Adjust \B tests to check if it matches outside
	a word.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-36
2008-01-09 16:11:43 +01:00
Paolo Bonzini b48e80e8ad prepare for 4.1.4 release
2005-01-25  Paolo Bonzini  <bonzini@gnu.org>

	* sed/regexp.c: Fix building on GCC 2.95 and earlier.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-35
2008-01-09 16:11:42 +01:00
Paolo Bonzini 32cf31f2ba compute inveclosure only if actually needed.
2004-12-31  Paolo Bonzini  <bonzini@gnu.org>

	* regcomp.c (calc_inveclosure): Return reg_errcode_t.
	Initialize the node sets in dfa->inveclosures.
	(analyze): Initialize inveclosures only if it is needed.
	Check errors from calc_inveclosure.
	* regex_internal.c (re_dfa_add_node): Do not initialize
	the inveclosure node set.
	* regexec.c (re_search_internal): If nmatch includes unused
	subexpressions, reset them to { rm_so: -1, rm_eo: -1 } here.
	Limit to preg->re_nsubs the nmatch that is passed to set_regs.
	(set_regs): Remove the real_nmatch variable, the nmatch
	parameter now is <= preg->re_nsubs.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-34
2008-01-09 16:11:41 +01:00
Paolo Bonzini 5135bf4814 do not use leftmost-longest matching for addresses.
2004-12-26  Paolo Bonzini  <bonzini@gnu.org>

	Do not use leftmost-longest matching for addresses.

	* NEWS: Add a note about this.
	* testsuite/recall2.good, testsuite/recall2.inp,
	testsuite/recall2.sed: New test.
	* testsuite/Makefile.am, testsuite/Makefile.tests: Add the
	recall2 test.
	* sed/sed.h (struct regex): New.
	(struct addr, struct subst, compile_regex, match_regex,
	release_regex): Use it instead of regex_t.
	* sed/compile.c (compile_program): Update for new meaning of
	the third parameter of compile_regex.
	* sed/execute.c (do_subst): Pass less conservative value to
	the regsize parameter of match_regex.
	* sed/regexp.c (compile_regex_1): New, extracted out of
	compile_regex.  The third parameter, needed_sub, now includes
	\0 (so 10 means that \0 .. \9 are needed).  Pass RE_NO_SUB
	if needed_sub is zero.
	(compile_regex): Accept a struct regex instead of a regex_t.
	Save the regular expression's text.
	(match_regex): Accept a struct regex instead of a regex_t.
	Recompile the pattern if it was compiled with RE_NO_SUB.
	(release_regex): Accept a struct regex instead of a regex_t.

	* doc/Makefile.am: Generate sed.texi correctly when
	building outside srcdir.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-33
2008-01-09 16:11:40 +01:00
Paolo Bonzini 84342a5b93 commit autogenerated sed.texi.
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-32
2008-01-09 16:11:40 +01:00
Paolo Bonzini bc7f50307a warn against localization issues
2004-12-26  Paolo Bonzini  <bonzini@gnu.org>

	* BUGS: Add section about [a-z] matching uppercase characters,
	and other locale issues.
	* doc/sed-in.texi [!PERL]: Likewise.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-31
2008-01-09 16:11:39 +01:00
Paolo Bonzini 65048613e4 speed up transit_state_mb
2004-12-27  Paolo Bonzini  <bonzini@gnu.org>

	* lib/regexec.c (transit_state_mb): Do not examine nodes where
	the ACCEPT_MB is not set.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-30
2008-01-09 16:11:38 +01:00
Paolo Bonzini 312aa45e81 separate parsing and creation of the NFA. Avoid recursion on the parse tree.
2004-12-13  Paolo Bonzini  <bonzini@gnu.org>

	Separate parsing and creation of the NFA.  Avoided recursion on
	the (very unbalanced) parse tree.

	* regcomp.c (struct subexp_optimize, analyze_tree, calc_epsdest,
	re_dfa_add_tree_node, mark_opt_subexp_iter): Removed.
	(optimize_subexps, duplicate_tree, calc_first, calc_next,
	mark_opt_subexp): Rewritten.
	(preorder, postorder, lower_subexps, lower_subexp, link_nfa_nodes,
	create_token_tree, free_tree, free_token): New.
	(analyze): Accept a regex_t *.  Invoke the passes via the preorder and
	postorder generic visitors.  Do not initialize the fields in the
	re_dfa_t that represent the transitions.
	(free_dfa_content): Use free_token.
	(re_compile_internal): Analyze before UTF-8 optimizations.  Do not
	include optimization of subexpressions.
	(create_initial_state): Fetch the DFA node index from the first node's
	bin_tree_t *.
	(optimize_utf8): Abort on unexpected nodes, including OP_DUP_QUESTION.
	Return on COMPLEX_BRACKET.
	(duplicate_node_closure): Fix comment.
	(duplicate_node): Do not initialize the fields in the
	re_dfa_t that represent the transitions.
	(calc_eclosure, calc_inveclosure): Do not handle OP_DELETED_SUBEXP.
	(create_tree): Remove final argument.  All callers adjusted.  Rewritten
	to use create_token_tree.
	(parse_reg_exp, parse_branch, parse_expression, parse_bracket_exp,
	build_charclass_op): Use create_tree or create_token_tree instead
	of re_dfa_add_tree_node.
	(parse_dup_op): Likewise.  Also free the tree using free_tree for
	"<re>{0}", and lower OP_DUP_QUESTION to OP_ALT: "a?" is equivalent
	to "a|".  Adjust invocation of mark_opt_subexp.
	(parse_sub_exp): Create a single SUBEXP node.
	* regex_internal.c (re_dfa_add_node): Remove last parameter, always
	perform as if it was 1.  Do not initialize OPT_SUBEXP and DUPLICATED,
	and initialize the DFA fields representing the transitions.
	* regex_internal.h (re_dfa_add_node): Adjust prototype.
	(re_token_type_t): Move OP_DUP_PLUS and OP_DUP_QUESTION to the tokens
	section.  Add a tree-only code SUBEXP.  Remove OP_DELETED_SUBEXP.
	(bin_tree_t): Include a full re_token_t for TOKEN.  Turn FIRST and
	NEXT into pointers to trees.  Remove ECLOSURE.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-29
2008-01-09 16:11:38 +01:00
Paolo Bonzini 827706c007 speed up parentheses
2004-12-07  Paolo Bonzini  <bonzini@gnu.org>

	* regexec.c (proceed_next_node): Simplify treatment of epsilon
	nodes.  Pass the pushed node to push_fail_stack.
	(push_fail_stack): Accept a single node rather than an array
	of two epsilon destinations.
	(build_sifted_states): Only walk non-epsilon nodes.
	(check_arrival): Don't pass epsilon nodes to
	check_arrival_add_next_nodes.
	(check_arrival_add_next_nodes) [DEBUG]: Abort if an epsilon node is
	found.
	(check_node_accept): Do expensive checks later.
	(add_epsilon_src_nodes): Cache result of merging the inveclosures.
	* regex-internal.h (re_dfastate_t): Add non_eps_nodes and inveclosure.
	(re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at,
	re_string_context_at, re_string_peek_byte_case,
	re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains):
	Declare as pure.
	* regex-internal.c (create_newstate_common): Remove.
	(register_state): Move part of it here.  Initialize non_eps_nodes.
	(free_state): Free inveclosure and non_eps_nodes.
	(create_cd_newstate, create_ci_newstate): Allocate the new
	re_dfastate_t here.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-28
2008-01-09 16:11:37 +01:00
Paolo Bonzini 14f43c2486 Fix bugs in the accept_mb optimization.
2004-12-03  Paolo Bonzini  <bonzini@gnu.org>

	* regcomp.c (peek_token, parse_expression, build_charclass_op): Do
	not set accept_mb in the token.
	(parse_bracket_exp): Do not modify existing DFA nodes.
	* regex-internal.c (re_node_set_insert_last): Remove unused variable.
	(re_dfa_add_node): Set accept_mb in the DFA node.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-27
2008-01-09 16:11:36 +01:00
Paolo Bonzini 52e232ab96 do not make single-byte searches go through slow MBCS paths
2004-01-12  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regcomp.c (peek_token, parse_bracket_exp, build_charclass_op)
	[RE_ENABLE_I18N]: Initialize the tokens' accept_mb field.
	* posix/regex_internal.c (create_ci_newstate, create_cd_newstate)
	[RE_ENABLE_I18N]: Initialize the DFA state's accept_mb field
	from the nodes'.
	* posix/regex_internal.h (re_token_t) [RE_ENABLE_I18N]: Add the
	accept_mb bitfield.
	(ACCEPT_MB_NODE): Remove.
	* posix/regexec.c (transit_state_mb, check_arrival_add_next_nodes,
	proceed_next_node, build_sifted_states): Look at the nodes' accept_mb
	field.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-26
2008-01-09 16:11:36 +01:00
Paolo Bonzini 8a00600bfc simplify handling of subexpressions
2004-12-01  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regcomp.c (free_dfa_content, init_dfa): Remove
	references to re_dfa_t's subexps field.
	(parse_sub_exp, parse_expression): Do not use it.  Use
	completed_bkref_map instead.
	(create_initial_state, peek_token): Store a backreference \N
	with opr.idx = N-1.
	* posix/regexec.c (proceed_next_node, check_dst_limits,
	get_subexp): Likewise.
	(check_subexp_limits): Remove useless condition.
	* posix/regex_internal.h (re_subexp_t): Remove.
	(re_dfa_t): Remove subexps and subexps_alloc field, add
	completed_bkref_map.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-25
2008-01-09 16:11:35 +01:00
Paolo Bonzini d7af1f9383 fix off by one error in check_dst_limits_calc_pos_1
2004-11-30  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regexec.c (check_dst_limits_calc_pos_1): Check
	for bkref_idx == -1, and don't recurse in that case.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-24
2008-01-09 16:11:34 +01:00
Paolo Bonzini deb1e06415 speed up .{1,2048}
2004-11-23  Paolo Bonzini  <bonzini@gnu.org>

	* regcomp.c (analyze_tree): Always call calc_epsdest.
	(calc_inveclosure): Use re_node_set_insert_last.
	(parse_dup_op): Lower X{1,5} to (X(X(X(XX?)?)?)?)?
	rather than X?X?X?X?X?.
	* regex_internal.h (re_node_set_insert_last): New declaration.
	* regex_internal.c (re_node_set_insert_last): New function.
	* PCRE.tests: Add testcases.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-22
2008-01-09 16:10:55 +01:00
Paolo Bonzini 2e543b5d13 restore transit_state optimization, lost in previous checkin
previous checkin was a merge from glibc

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-21
2008-01-09 16:10:54 +01:00
Paolo Bonzini 611e77d579 git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-20 2008-01-09 16:10:54 +01:00
Paolo Bonzini 7f53c1c16e fix \l and \u in a multi-byte configuration
2004-11-15  Paolo Bonzini  <bonzini@gnu.org>

	* sed/execute.c (str_append_modified): Copy the first character
	when using \l or \u in a multi-byte configuration.  Use
	WCRTOMB instead of wcrtomb.
	* sed/sed.h (WCRTOMB): New.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-19
2008-01-09 16:10:53 +01:00
Paolo Bonzini fd8f5daad7 more portability improvements
2004-11-11  Paolo Bonzini  <bonzini@gnu

	* tst-rxspecer.c: Do not mix instructions and
	declarations.
	* basicdefs.h: Include locale.h before #defining
	gettext, to avoid breakage under Solaris.
	* sed/sed.c: do not include locale.h.

po:
2004-11-11  Paolo Bonzini  <bonzini@gnu.org>

	* Makevars: New.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-18
2008-01-09 16:10:52 +01:00
Paolo Bonzini 8da18b06bb cache result of check_dst_limits_calc_pos_1
2004-09-11  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regex_internal.h (struct re_backref_cache_entry):
	Add a map of reachable subexpression nodes from each backreference
	cache entry.
	* posix/regexec.c (check_dst_limits_calc_pos_1): Use the map
	to cut recursive paths.  Make exit condition more precise.
	(match_ctx_add_entry): Initialize the map.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-17
2008-01-09 16:10:52 +01:00
Paolo Bonzini a525606abd merge from glibc
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-16
2008-01-09 16:10:51 +01:00
Paolo Bonzini c27b981aba add tagging conventions and fix configure for gettext 0.14
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-15
2008-01-09 16:10:50 +01:00
Paolo Bonzini 6a02cd80dc use utf8 optimizations outside glibc
2004-09-08  Paolo Bonzini  <bonzini@gnu.org>

	* regcomp.c (init_dfa): Get the codeset name outside glibc as
	well.  Check if it is spelled UTF8 as well as UTF-8, and check
	case-insensitively.  Set dfa->map_notascii manually when outside
	glibc.
	* regex_internal.c (build_wcs_upper_buffer) [!_LIBC]: Enable
	optimizations based on map_notascii.
	* regex_internal.h [HAVE_LANGINFO_H || HAVE_LANGINFO_CODESET
	|| _LIBC]: Include langinfo.h.

git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-14
2008-01-09 16:10:49 +01:00
Paolo Bonzini 6375df4662 remove ABOUT-NLS from archive
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-13
2008-01-09 16:10:49 +01:00