Skip to contentSkip to conversation

lxr-0.3.1 handle `_' fix

PATCH New Coywolf Qi Hunt 1 participant 1 message Apr 29, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lxr-0.3.1 handle `_' fix

Hello,

lxr-0.3.1 can not handle '_' in the Architecture variable.

Like <http://sosdg.org/~coywolf/lxr/source/include/asm-x86_64/?a=x86_64>
is wrongly shown as <http://sosdg.org/~coywolf/lxr/source/include/asm-/?a=x86_64>

This problem was brought in by the file exposure security fix some time ago iirc.

Coywolf

http/lib/LXR/Config.pm renamed from http/lib/LXR/Config.pm.orig +1 -1
diff -pu lxr/http/lib/LXR/Config.pm.orig lxr/http/lib/LXR/Config.pm
@@ -156,7 +156,7 @@ sub varrange {
 sub varexpand {
     my ($self, $exp) = @_;
     $exp =~ s{\$\{?(\w+)\}?}{
-       $self->{variable}->{$1} =~ /^([a-zA-Z0-9\.\-]*)$/ ? $1 : ''
+       $self->{variable}->{$1} =~ /^([a-zA-Z0-9\.\-_]*)$/ ? $1 : ''
        }ge;
     return($exp);
 }