aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-02-26 14:56:23 +0000
committerThierry Vignaud <tv@mandriva.org>2008-02-26 14:56:23 +0000
commit5e628c50f3a3e10f9e6a4a270143f1a3076296e1 (patch)
tree81736c88fe3aa9b3eb7d75ac40195fa9aba30782
parentb45d8989f54d8194d72c7049dc48d424db23d09f (diff)
downloadrpmdrake-5e628c50f3a3e10f9e6a4a270143f1a3076296e1.tar
rpmdrake-5e628c50f3a3e10f9e6a4a270143f1a3076296e1.tar.gz
rpmdrake-5e628c50f3a3e10f9e6a4a270143f1a3076296e1.tar.bz2
rpmdrake-5e628c50f3a3e10f9e6a4a270143f1a3076296e1.tar.xz
rpmdrake-5e628c50f3a3e10f9e6a4a270143f1a3076296e1.zip
(do_search) remove leading/trailing spacing in searched word when pasting (#23249)
-rwxr-xr-xrpmdrake6
1 files changed, 6 insertions, 0 deletions
diff --git a/rpmdrake b/rpmdrake
index b113cf5b..ae3fed2c 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -55,6 +55,12 @@ our $statusbar;
sub do_search($$$$$$$) {
my ($find_entry, $tree, $tree_model, $options, $current_search_type, $urpm, $pkgs) = @_;
my $entry = $find_entry->get_text or return;
+ # remove leading/trailing spacing when pasting:
+ if ($entry !~ /\S\s\S/) {
+ # if spacing in middle, likely a string search in description
+ $entry =~ s/^\s*//;
+ $entry =~ s/^\s*$//;
+ }
my $entry_rx = eval { qr/$entry/i } or return;
my $results_ok = N("Search results");
$options->{delete_category}->($_) foreach $results_ok;