diff --git a/ChangeLog b/ChangeLog index 94926db..89b7c67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-02-03 Paolo Bonzini + + * sed/compile.c (compile_program) : Pass false to match_slash. + 2005-09-07 Paolo Bonzini * lib/regcomp.c: Update from upstream. diff --git a/Makefile.am b/Makefile.am index 06fbb32..a6ecc04 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,7 +23,9 @@ EXTRA_DC_FLAGS = full-distcheck: make distcheck EXTRA_DC_FLAGS='--enable-html' make distcheck EXTRA_DC_FLAGS='--disable-i18n' + make distcheck EXTRA_DC_FLAGS='--disable-nls' make distcheck EXTRA_DC_FLAGS='--without-included-regex' + make distcheck EXTRA_DC_FLAGS='--without-included-gettext' update-regex: HOST=sources.redhat.com && \ diff --git a/NEWS b/NEWS index b0f3af5..233ffef 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ Sed 4.1.5 * fix parsing of a negative character class not including a closed bracket, like [^]] or [^]a-z]. +* fix parsing of [ inside an y command, like y/[/A/. + * output the result of commands a, r, R when a q command is found. ---------------------------------------------------------------------------- diff --git a/sed/compile.c b/sed/compile.c index 28b6405..e35608a 100644 --- a/sed/compile.c +++ b/sed/compile.c @@ -1,5 +1,5 @@ /* GNU SED, a batch stream editor. - Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003 + Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2004,2005,2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -1274,12 +1274,12 @@ compile_program(vector) char *src_buf, *dest_buf; slash = inchar(); - if ( !(b = match_slash(slash, true)) ) + if ( !(b = match_slash(slash, false)) ) bad_prog(_(UNTERM_Y_CMD)); src_buf = get_buffer(b); len = normalize_text(src_buf, size_buffer (b), TEXT_BUFFER); - if ( !(b2 = match_slash(slash, true)) ) + if ( !(b2 = match_slash(slash, false)) ) bad_prog(_(UNTERM_Y_CMD)); dest_buf = get_buffer(b2); dest_len = normalize_text(dest_buf, size_buffer (b2), TEXT_BUFFER); diff --git a/sed/execute.c b/sed/execute.c index 195604b..5e8a38a 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -1,6 +1,5 @@ - /* GNU SED, a batch stream editor. - Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003 + Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2004,2005,2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index b53abe1..cdf761c 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -20,8 +20,8 @@ SEDTESTS += \ appquit enable sep inclib 8bit newjis xabcx dollar noeol noeolw \ modulo 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 \ - allsub cv-vars classes middle bsd stdin flipcase \ + fasts uniq manis khadafy linecnt eval distrib 8to7 y-bracket \ + y-newline allsub cv-vars classes middle bsd stdin flipcase \ insens subwrite writeout readin \ help version file quiet \ factor binary3 binary2 binary dc @@ -80,7 +80,9 @@ EXTRA_DIST = \ xabcx.good xabcx.inp xabcx.sed \ xbxcx.good xbxcx.inp xbxcx.sed \ xbxcx3.good xbxcx3.inp xbxcx3.sed \ - xemacs.good xemacs.inp xemacs.sed + xemacs.good xemacs.inp xemacs.sed \ + y-bracket.good y-bracket.sed y-bracket.inp \ + y-newline.good y-newline.sed y-newline.inp clean-local: test x$(srcdir) = x. || rm -f readin.in2 eval.in2 diff --git a/testsuite/Makefile.tests b/testsuite/Makefile.tests index c82d629..eada28d 100644 --- a/testsuite/Makefile.tests +++ b/testsuite/Makefile.tests @@ -13,7 +13,8 @@ RM=rm -f enable sep inclib 8bit 8to7 newjis xabcx dollar noeol bkslashes \ numsub head madding mac-mf empty xbxcx xbxcx3 recall recall2 xemacs \ -appquit fasts uniq manis linecnt khadafy allsub flipcase space modulo:: +appquit fasts uniq manis linecnt khadafy allsub flipcase space modulo \ +y-bracket y-newline:: $(SEDENV) $(SED) -f $(srcdir)/$@.sed \ < $(srcdir)/$@.inp > $@.out $(CMP) $(srcdir)/$@.good $@.out diff --git a/testsuite/y-bracket.good b/testsuite/y-bracket.good new file mode 100644 index 0000000..278fee9 --- /dev/null +++ b/testsuite/y-bracket.good @@ -0,0 +1 @@ +Are you sure (y/n)? y] diff --git a/testsuite/y-bracket.inp b/testsuite/y-bracket.inp new file mode 100644 index 0000000..fe6124f --- /dev/null +++ b/testsuite/y-bracket.inp @@ -0,0 +1 @@ +Are you sure (y/n)? [y] diff --git a/testsuite/y-bracket.sed b/testsuite/y-bracket.sed new file mode 100644 index 0000000..79f3b61 --- /dev/null +++ b/testsuite/y-bracket.sed @@ -0,0 +1 @@ +y/[/ / diff --git a/testsuite/y-newline.good b/testsuite/y-newline.good new file mode 100644 index 0000000..b0f2bfe --- /dev/null +++ b/testsuite/y-newline.good @@ -0,0 +1 @@ +Are Sou Yure (S/n)? [S] $$Are Sou Yure (S/n)? [S] diff --git a/testsuite/y-newline.inp b/testsuite/y-newline.inp new file mode 100644 index 0000000..fe6124f --- /dev/null +++ b/testsuite/y-newline.inp @@ -0,0 +1 @@ +Are you sure (y/n)? [y] diff --git a/testsuite/y-newline.sed b/testsuite/y-newline.sed new file mode 100644 index 0000000..3e1dbea --- /dev/null +++ b/testsuite/y-newline.sed @@ -0,0 +1,3 @@ +H +G +y/Ss\nYy/yY$sS/