From: Hans Mulder Date: Mon, 11 Jan 1999 22:22:45 +0000 (+0200) Subject: [Patch for 5.005_54] re::debugcolors dumps core X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c712d3769459fa50fd65778c268dc26d41922ffc;p=p5sagit%2Fp5-mst-13.2.git [Patch for 5.005_54] re::debugcolors dumps core To: perlbug@perl.com Cc: hansmu@xs4all.nl Message-ID: p4raw-id: //depot/cfgperl@2603 --- diff --git a/ext/re/re.pm b/ext/re/re.pm index 1c225e3..09f52d6 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -86,9 +86,10 @@ sub setcolor { my $terminal = Tgetent Term::Cap ({OSPEED => 9600}); # Avoid warning. my $props = $ENV{PERL_RE_TC} || 'md,me,so,se,us,ue'; my @props = split /,/, $props; + my $colors = join "\t", map {$terminal->Tputs($_,1)} @props; - - $ENV{PERL_RE_COLORS} = join "\t", map {$terminal->Tputs($_,1)} @props; + $colors =~ s/\0//g; + $ENV{PERL_RE_COLORS} = $colors; }; } diff --git a/regcomp.c b/regcomp.c index 19b030f..b930e8a 100644 --- a/regcomp.c +++ b/regcomp.c @@ -776,7 +776,7 @@ reginitcolors(void) PL_colors[i] = ++s; } else - PL_colors[i] = ""; + PL_colors[i] = s = ""; } } else { while (i < 6)