about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/LeiQuery.pm2
-rw-r--r--lib/PublicInbox/LeiSavedSearch.pm5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index 7456f7f9..7ddba4cf 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -143,7 +143,7 @@ no query allowed on command-line with --stdin
                 PublicInbox::InputPipe::consume($self->{0}, \&qstr_add, $self);
                 return;
         }
-        $mset_opt{q_raw} = \@argv;
+        $mset_opt{q_raw} = [ @argv ]; # copy
         $mset_opt{qstr} =
                 $self->{lse}->query_argv_to_string($self->{lse}->git, \@argv);
         _start_query($self);
diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm
index 815008fd..e79cf76a 100644
--- a/lib/PublicInbox/LeiSavedSearch.pm
+++ b/lib/PublicInbox/LeiSavedSearch.pm
@@ -25,12 +25,13 @@ sub new {
         } else { # new saved search "lei q --save"
                 my $saved_dir = $lei->store_path . '/../saved-searches/';
                 my (@name) = ($lei->{ovv}->{dst} =~ m{([\w\-\.]+)/*\z});
-                push @name, to_filename($lei->{mset_opt}->{qstr});
+                my $q = $lei->{mset_opt}->{q_raw} // die 'BUG: {q_raw} missing';
+                my $q_raw_str = ref($q) ? "@$q" : $q;
+                push @name, to_filename($q_raw_str);
                 $dir = $saved_dir . join('-', @name);
                 require File::Path;
                 File::Path::make_path($dir); # raises on error
                 $self->{'-f'} = "$dir/lei.saved-search";
-                my $q = $lei->{mset_opt}->{q_raw};
                 if (ref $q) {
                         cfg_set($self, '--add', 'lei.q', $_) for @$q;
                 } else {