summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Mulder <hansmu@xs4all.nl>1999-01-12 00:22:45 +0200
committerJarkko Hietaniemi <jhi@iki.fi>1999-01-13 18:06:56 +0000
commitc712d3769459fa50fd65778c268dc26d41922ffc (patch)
tree745a835db0c8b9dfa2fd4cf98f4801bbb046dae6
parent88b39979ed4ec47a51ecb175fcf086fb7df0ebdb (diff)
downloadperl-c712d3769459fa50fd65778c268dc26d41922ffc.tar.gz
[Patch for 5.005_54] re::debugcolors dumps core
To: perlbug@perl.com Cc: hansmu@xs4all.nl Message-ID: <MLIST_9901111947.AA22109@icgned.icgroup.nl> p4raw-id: //depot/cfgperl@2603
-rw-r--r--ext/re/re.pm5
-rw-r--r--regcomp.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/re/re.pm b/ext/re/re.pm
index 1c225e3a7c..09f52d6086 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 19b030f3d9..b930e8a0a3 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)