Re: [PATCH 1/3] sed: Fix infinite loop on some false multi-byte matches

Stanislav Brabec <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Organization SUSE Linux, s. r. o.
Message-ID <[email protected]>
On Sun Feb 12, 2012 at 09:30 PM +0200 Aharon Robbins wrote:
> I have been looking at this and trying to see if I can reproduce
> it in gawk. I can't seem too. Would someone who understands the
> issue supply me with a test awk program that either shows that
> gawk has this bug, or doesn't?

Here is a simple AWK reproducer. There should be no match in the whole
input file. (Replacements use fastmap, pattern match of lines does not.)

Please verify that your mail reader did not mangle EUC-JP strings in the
attachment. The strings are equal as those in sed and C example.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [email protected]
Lihovarská 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/
test-awk.sh (application/x-shellscript, 161 B)
#!/bin/sh
export LC_CTYPE=ja_JP.EUC-JP LC_ALL=
(
cat <<EOF
aa·ïa¿·½è
aaa·ïa¿·½è
aaaa·ïa¿·½è
aaaaa·ïa¿·½è
EOF
) | awk '
/.*/ { gsub ("·½", "ERROR"); print; }
' -
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.