Update of /cvsroot/lxr/lxr/lib/LXR
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24584/lib/LXR
Modified Files:
Common.pm
Log Message:
Correct pathname cleaning
Index: Common.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Common.pm,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- Common.pm 4 May 2005 23:19:33 -0000 1.51
+++ Common.pm 15 May 2005 22:59:31 -0000 1.52
@@ -169,7 +169,6 @@
return (undef);
}
- $t =~ s/\+/ /g;
$t =~ s/\%([\da-f][\da-f])/pack("C", hex($1))/gie;
return ($t);
@@ -539,10 +538,10 @@
if(defined $path) {
# First suppress anything after a dodgy character
- $path =~ s!(^[\w_+-,.%^/]+).*!$1!;
+ $path =~ s!(^[\w_+-,.%^/\!]+).*!$1!;
# Clean out /../
- while ($path =~ m!/../!) {
- $path = s!/\.\./!/!g;
+ while ($path =~ m!/\.\.?/!) {
+ $path =~ s!/\.\.?/!/!g;
}
}
|