Skip to content

Commit

Permalink
Lukas Mai discovered a bug in the include .inputrc directive and was
Browse files Browse the repository at this point in the history
kind enough to submit a patch.
  • Loading branch information
rcaputo committed Mar 18, 2007
1 parent f71e9a6 commit bf425fd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/POE/Wheel/ReadLine.pm
Expand Up @@ -1258,7 +1258,7 @@ sub _parse_inputrc {
foreach my $line (split(/\n+/, $input)) {
next if $line =~ /^#/;
if ($line =~ /^\$(.*)/) {
my (@parms) = split(/[ +=]/,$1);
my (@parms) = split(/[ \t+=]/,$1);
if ($parms[0] eq 'if') {
my $bool = 0;
if ($parms[1] eq 'mode') {
Expand All @@ -1280,9 +1280,14 @@ sub _parse_inputrc {
pop(@cond);
} elsif ($parms[0] eq 'include') {
if ($depth > 10) {
print STDERR "WARNING: ignoring 'include $parms[1] directive, since we're too deep";
print STDERR "WARNING: ignoring ``include $parms[1] directive, since we're too deep''";
} else {
$self->_parse_inputrc($input, $depth+1);
my $fh = gensym;
if (open $fh, "< $parms[1]\0") {
my $contents = do { local $/; <$fh> };
close $fh;
$self->_parse_inputrc($contents, $depth+1);
}
}
}
} else {
Expand Down

0 comments on commit bf425fd

Please sign in to comment.