*** ../../../twiki20030201/lib/TWiki/Search.pm Sun Jan 5 02:36:46 2003 --- Search.pm Fri Feb 7 13:03:20 2003 *************** *** 211,219 **** my $cmd = ""; if( $theScope eq "topic" ) { $cmd = "$TWiki::lsCmd %FILES% | %GREP% %SWITCHES% -- $TWiki::cmdQuote%TOKEN%$TWiki::cmdQuote"; ! } else { $cmd = "%GREP% %SWITCHES% -l -- $TWiki::cmdQuote%TOKEN%$TWiki::cmdQuote %FILES%"; } if( $caseSensitive ) { $tempVal = ""; --- 211,222 ---- my $cmd = ""; if( $theScope eq "topic" ) { $cmd = "$TWiki::lsCmd %FILES% | %GREP% %SWITCHES% -- $TWiki::cmdQuote%TOKEN%$TWiki::cmdQuote"; ! } elsif ( $theScope eq "text") { $cmd = "%GREP% %SWITCHES% -l -- $TWiki::cmdQuote%TOKEN%$TWiki::cmdQuote %FILES%"; + } else { + $cmd = "$TWiki::lsCmd %FILES% | %GREP% %SWITCHES% -- $TWiki::cmdQuote%TOKEN%$TWiki::cmdQuote ; %GREP% %SWITCHES% -l -- $TWiki::cmdQuote%TOKEN%$TWiki::cmdQuote %FILES%"; } + if( $caseSensitive ) { $tempVal = ""; *************** *** 283,290 **** @topicList = ( "*.txt" ); foreach my $token ( @tokens ) { my $acmd = $cmd; ! $acmd =~ s/%TOKEN%/$token/o; ! $acmd =~ s/%FILES%/@topicList/; $acmd =~ /(.*)/; $acmd = "$1"; # untaint variable (NOTE: Needs a better check!) $tempVal = `$acmd`; --- 286,293 ---- @topicList = ( "*.txt" ); foreach my $token ( @tokens ) { my $acmd = $cmd; ! $acmd =~ s/%TOKEN%/$token/go; ! $acmd =~ s/%FILES%/@topicList/g; $acmd =~ /(.*)/; $acmd = "$1"; # untaint variable (NOTE: Needs a better check!) $tempVal = `$acmd`; *************** *** 296,306 **** my @tmpList = map { /(.*)\.txt$/; $_ = $1; } @topicList; @topicList = (); my $lastTopic = ""; ! foreach( @tmpList ) { $tempVal = $_; # make topic unique if( $tempVal ne $lastTopic ) { push @topicList, $tempVal; } } } --- 299,310 ---- my @tmpList = map { /(.*)\.txt$/; $_ = $1; } @topicList; @topicList = (); my $lastTopic = ""; ! foreach( sort @tmpList ) { $tempVal = $_; # make topic unique if( $tempVal ne $lastTopic ) { push @topicList, $tempVal; + $lastTopic = $tempVal; } } }