From faaf9ad2cd4d5a1d5af0a061ebd19f266b014005 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 10 Feb 2005 09:53:36 +0000 Subject: [PATCH] sync with sed--stable--4.1 2005-02-10 Paolo Bonzini * 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. 2005-02-10 Paolo Bonzini * sed/regexp.c: Fix off-by-one error in the "invalid reference to subexpression" message. Debian bug 294339. Patches applied: * bonzini@gnu.org--2004b/sed--stable--4.1--patch-42 fix debian bug 294339 * bonzini@gnu.org--2004b/sed--stable--4.1--patch-43 fix crash on /\(\)/x * bonzini@gnu.org--2004b/sed--stable--4.1--patch-44 fix a/r/R commands when q is encountered git-archimport-id: bonzini@gnu.org--2004b/sed--ssed--3.61--patch-19 --- ChangeLog | 14 ++++++++++++++ NEWS | 4 +++- sed/execute.c | 1 + sed/regexp.c | 2 +- testsuite/Makefile.am | 3 ++- testsuite/Makefile.tests | 2 +- testsuite/appquit.good | 2 ++ testsuite/appquit.inp | 1 + testsuite/appquit.sed | 4 ++++ testsuite/readin.good | 2 -- testsuite/readin.sed | 1 + 11 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 testsuite/appquit.good create mode 100644 testsuite/appquit.inp create mode 100644 testsuite/appquit.sed diff --git a/ChangeLog b/ChangeLog index 386702a..6f4fbc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2005-02-10 Paolo Bonzini + + * 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. + +2005-02-10 Paolo Bonzini + + * sed/regexp.c: Fix off-by-one error in the "invalid reference + to subexpression" message. Debian bug 294339. + 2005-02-08 Paolo Bonzini * lib/obstack.h: include config.h. diff --git a/NEWS b/NEWS index e06b5e3..bec34ae 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -Sed 3.62 (aligned with GNU sed 4.1.3) +Sed 3.62 (aligned with GNU sed CVS at 2005-02-10) * added a note to BUGS and the manual about changed interpretation of `s|abc\|def||', and about localization issues. @@ -7,6 +7,8 @@ Sed 3.62 (aligned with GNU sed 4.1.3) * fixed `make check' in non-English locales. +* output the result of commands a, r, R when a q command is found. + ----------------------------------------------------------------------- Sed 3.61a diff --git a/sed/execute.c b/sed/execute.c index fb3f509..e05dbb9 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -1466,6 +1466,7 @@ execute_program(vec, input) case 'q': if (!no_default_output) output_line(line.active, line.length, line.chomped, &output_file); + dump_append_queue(); case 'Q': return cur_cmd->x.int_arg == -1 ? 0 : cur_cmd->x.int_arg; diff --git a/sed/regexp.c b/sed/regexp.c index 56b4caa..bffbfb6 100644 --- a/sed/regexp.c +++ b/sed/regexp.c @@ -113,7 +113,7 @@ compile_regex_1 (new_regex, needed_sub) { char buf[200]; sprintf(buf, _("invalid reference \\%d on `s' command's RHS"), - needed_sub); + needed_sub - 1); bad_prog(buf); } } diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index ab4cd45..466410b 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -9,7 +9,7 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/pcre \ -I$(top_builddir)/intl -I$(top_srcdir)/intl SEDTESTS = \ - space enable sep inclib 8bit newjis xabcx dollar noeol noeolw \ + space appquit enable sep inclib 8bit newjis xabcx dollar noeol noeolw \ numsub numsub2 numsub3 numsub4 numsub5 0range bkslashes \ head madding mac-mf empty xbxcx xbxcx3 recall recall2 xemacs \ fasts uniq manis khadafy linecnt eval distrib 8to7 \ @@ -28,6 +28,7 @@ EXTRA_DIST = runtest Makefile.tests \ 8bit.good 8bit.inp 8bit.sed \ 8to7.good 8to7.inp 8to7.sed \ allsub.good allsub.inp allsub.sed \ + appquit.good appquit.inp appquit.sed \ binary.good binary.inp binary.sed binary2.sed binary3.sed \ bkslashes.good bkslashes.inp bkslashes.sed \ bsd.good bsd.sh \ diff --git a/testsuite/Makefile.tests b/testsuite/Makefile.tests index eaf393b..8aa2ea9 100644 --- a/testsuite/Makefile.tests +++ b/testsuite/Makefile.tests @@ -13,7 +13,7 @@ RM=rm -f enable sep inclib 8bit 8to7 newjis xabcx dollar noeol bkslashes \ numsub head madding mac-mf empty xbxcx xbxcx3 recall recall2 xemacs \ -fasts uniq manis linecnt khadafy allsub flipcase space:: +appquit fasts uniq manis linecnt khadafy allsub flipcase space:: $(SEDENV) $(SED) -f $(srcdir)/$@.sed \ < $(srcdir)/$@.inp > $@.out $(CMP) $(srcdir)/$@.good $@.out diff --git a/testsuite/appquit.good b/testsuite/appquit.good new file mode 100644 index 0000000..0742c8e --- /dev/null +++ b/testsuite/appquit.good @@ -0,0 +1,2 @@ +doh +ok diff --git a/testsuite/appquit.inp b/testsuite/appquit.inp new file mode 100644 index 0000000..a2300c9 --- /dev/null +++ b/testsuite/appquit.inp @@ -0,0 +1 @@ +doh diff --git a/testsuite/appquit.sed b/testsuite/appquit.sed new file mode 100644 index 0000000..fc11774 --- /dev/null +++ b/testsuite/appquit.sed @@ -0,0 +1,4 @@ +# Test appending quit +a\ +ok +q diff --git a/testsuite/readin.good b/testsuite/readin.good index a3ba1b6..479a444 100644 --- a/testsuite/readin.good +++ b/testsuite/readin.good @@ -17,5 +17,3 @@ MOO MOO I live here, too. MOO - I want freedom just as you.'' - ``The Weary Blues'', Langston Hughes diff --git a/testsuite/readin.sed b/testsuite/readin.sed index adcc6bc..fac07a4 100644 --- a/testsuite/readin.sed +++ b/testsuite/readin.sed @@ -1 +1,2 @@ /\.$/r readin.in2 +/too\.$/q