[Lxr-commits] CVS: lxr/scripts ContextMgr.pm,1.5,1.6
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2014-03-10 10:09:31
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16618/scripts Modified Files: ContextMgr.pm Log Message: scripts/ContextMgr.pm: fix for bug #251 (host/alias names truncated to their first characters) Host/alias names are extracted from URL with too strict a regular expression (using "greedy" qualifier). Fixed by removing ? qualifier after + repetition. Also, in contextSave(), replaced ' string delimiters with " to allow interpolation of escape constructs. Index: ContextMgr.pm =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/ContextMgr.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ContextMgr.pm 7 Nov 2013 17:38:36 -0000 1.5 +++ ContextMgr.pm 10 Mar 2014 10:09:28 -0000 1.6 @@ -319,13 +319,13 @@ print DEST "\$port = '$port';\n"; # @hostaliases added in version 3 print DEST '@schemealiases = qw( '; - print DEST join ('\n , ', @schemealiases); + print DEST join ("\n , ", @schemealiases); print DEST "\n );\n"; print DEST '@hostaliases = qw( '; - print DEST join ('\n , ', @hostaliases); + print DEST join ("\n , ", @hostaliases); print DEST "\n );\n"; print DEST '@portaliases = qw( '; - print DEST join ('\n , ', @portaliases); + print DEST join ("\n , ", @portaliases); print DEST "\n );\n"; print DEST "\$treematch = '$treematch';\n"; print DEST "\$commonvirtroot = $commonvirtroot;\n"; @@ -607,18 +607,13 @@ ? [ '//localhost' ] : [ ] ); - $primaryhost =~ m!^([^/]+)?//([^:]+?)(?::(\d+))?/?!; + $primaryhost =~ m!^([^/]+)?//([^:]+)(?::(\d+))?/?!; $scheme = $1; $hostname = $2; $port = $3; $scheme = 'http:' if !defined($1); $port = 80 if 'http:' eq $scheme && !defined($3); $port = 443 if 'https:' eq $1 && !defined($3); -# if (!defined($hostname)) { -# print "${VTred}ERROR:${VTnorm} invalid host name or scheme, try again ...\n"; -# $primaryhost = undef; -# next; -# } } my $aliashost; @schemealiases = (); @@ -634,14 +629,10 @@ ) ) ) {; - $aliashost =~ m!^([^/]+)?//([^:]+?)(?::(\d+))?/?!; + $aliashost =~ m!^([^/]+)?//([^:]+)(?::(\d+))?/?!; my $aliasscheme = $1; my $aliasname = $2; my $aliasport = $3; -# if (!defined($aliasname)) { -# print "${VTred}ERROR:${VTnorm} invalid host name or scheme, try again ...\n"; -# next; -# } $aliasscheme = 'http:' if !defined($1); $aliasport = 80 if 'http:' eq $aliasscheme && !defined($3); $aliasport = 443 if 'https:' eq $1 && !defined($3); |