dbg("sh/dx list: " . join(" ", @list)) if isdbg('sh/dx');
+
+# $DB::single=1;
while (@list) { # next field
$f = shift @list;
} else {
$pre .= '*' unless $pre =~ /[\*\?\[]$/o;
$pre = shellregex($pre);
- if ($usesql) {
- $pre =~ s/\.\*/%/g;
- } else {
- $pre =~ s/\.\*\$$//;
- }
+ $pre =~ s/\.\*\$$//;
$pre .= '$' if $exact;
$pre =~ s/\^//;
push @flist, 'call', $pre;
# now do the search
- if ($self->{_nospawn}) {
- my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter ? $self : undef);
+ if ($self->{_nospawn} || ($Spot::spotcachedays && !$expr && $from == 0 && $fromday == 0 && $today == 0)) {
+ my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter, $self);
my $ref;
my @dx;
foreach $ref (@res) {
push @out, DXCommandmode::format_dx_spot($self, @$ref);
}
else {
- push @out, Spot::formatl(@$ref);
+ push @out, Spot::formatl($self->{width}, @$ref);
}
}
}
}
else {
push @out, $self->spawn_cmd("sh/dx $line", \&Spot::search,
- args => [$expr, $fromday, $today, $from, $to, $filter, $dofilter ? $self : undef],
+ args => [$expr, $fromday, $today, $from, $to, $filter, $dofilter, $self],
cb => sub {
my ($dxchan, @res) = @_;
my $ref;
push @out, DXCommandmode::format_dx_spot($self, @$ref);
}
else {
- push @out, Spot::formatl(@$ref);
+ push @out, Spot::formatl($self->{width}, @$ref);
}
}
}