]> dxcluster.net Git - spider.git/commitdiff
improve shellregex handling a bit esp. for SQL stuff
authorminima <minima>
Sat, 7 Jan 2006 18:22:17 +0000 (18:22 +0000)
committerminima <minima>
Sat, 7 Jan 2006 18:22:17 +0000 (18:22 +0000)
cmd/show/dx.pl
perl/DXSql.pm

index 0728c650dbd20918d580788d91f0bcd52fa9c537..6908a52779efebe6429a051661da18c79499f56e 100644 (file)
@@ -173,8 +173,13 @@ if ($pre) {
                }
        } 
        unless (@ans) {
-               $pre .= '*' unless $pre =~ /[\*\?\[]/o;
+               $pre .= '*' unless $pre =~ /[\*\?\[]$/o;
                $pre = shellregex($pre);
+               if ($main::dbh) {
+                       $pre =~ s/\.\*/%/g;
+               } else {
+                       $pre =~ s/\.\*\$$//;
+               }
                $expr = "\$f1 =~ m{$pre}";
                $pre =~ s/[\^\$]//g;
                $hint = "m{\U$pre}";
@@ -245,6 +250,11 @@ if ($spotter) {
                $expr .= ' && ' if $expr;
                $spotter .= '*' unless $spotter =~ /[\*\?\[]/o;
                $spotter = shellregex($spotter);
+               if ($main::dbh) {
+                       $spotter =~ s/\.\*/%/g;
+               } else {
+                       $spotter =~ s/\.\*\$$//;
+               }
                $expr .= "\$f4 =~ m{\U$spotter}";
                $hint .= ' && ' if $hint;
                $spotter =~ s/[\^\$]//g;
index fcf4e4ce5608dd5fc4068f4adb2c19924278483f..a2194a7b2f7618a06f0ba10a1b1064f69f22e0d5 100644 (file)
@@ -170,7 +170,7 @@ sub spot_search
                $expr =~ s/\$f9/spotcq/g;
                $expr =~ s/\|\|/ or /g;
                $expr =~ s/\&\&/ and /g;
-               $expr =~ s/=~\s+m\{\^([\w]+)[^\}]*\}/ like '$1%'/g;
+               $expr =~ s/=~\s+m\{\^([%\w]+)[^\}]*\}/ like '$1'/g;
        } else {
                $expr = '';
        }