Author: adam-guest
Date: 2008-06-27 19:52:03 +0000 (Fri, 27 Jun 2008)
New Revision: 1534

Modified:
   trunk/scripts/uscan.pl
Log:
Updates to enhanced-matching support by Raphael Geissert

Modified: trunk/scripts/uscan.pl
===================================================================
--- trunk/scripts/uscan.pl      2008-06-26 21:39:54 UTC (rev 1533)
+++ trunk/scripts/uscan.pl      2008-06-27 19:52:03 UTC (rev 1534)
@@ -823,8 +823,15 @@
            
            $base_dir =~ s%^\w+://[^/]+/%/%;
            if ($response_uri =~ m%^(\w+://[^/]+)%) {
-               push @patterns, "(?:(?:$1)?" . quotemeta($base_dir) . 
")?$filepattern";
-               push @sites, $1;
+               my $base_site = $1;
+
+               push @patterns, "(?:(?:$base_site)?" . quotemeta($base_dir) . 
")?$filepattern";
+               push @sites, $base_site;
+
+               # remove the filename, if any
+               $base_dir =~ s%/[^/]*$%/%;
+               push @patterns, "(?:(?:$base_site)?" . quotemeta($base_dir) . 
")?$filepattern";
+               push @sites, $base_site;
            }
        }
 
@@ -1045,8 +1052,8 @@
                }
            }
            if (!defined($upstream_url)) {
-               warn "$progname warning: Unable to determine upstream url\n";
-               return 1;
+               warn "$progname warning: Unable to determine upstream url\n" if 
$debug;
+               $upstream_url = "$sites[0]$newfile";
            }
        }
        # relative filename, we hope



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to