summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)