]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiQuery.pm
lei q: disallow "\n" in argv[] elements
[public-inbox.git] / lib / PublicInbox / LeiQuery.pm
index 3d0e5b144d3a9c939cc036e525283adc020c8a2c..51ee3d9c83e47b1fed21f02a9cc02b51751d2507 100644 (file)
@@ -37,7 +37,7 @@ sub _start_query { # used by "lei q" and "lei up"
                        $lms->lms_write_prepare->lms_pause; # just create
                }
        }
-       $l2m and $l2m->{-wq_nr_workers} = $mj //
+       $l2m and $l2m->{-wq_nr_workers} //= $mj //
                int($nproc * 0.75 + 0.5); # keep some CPU for git
 
        # descending docid order is cheapest, MUA controls sorting order
@@ -141,6 +141,7 @@ no query allowed on command-line with --stdin
                PublicInbox::InputPipe::consume($self->{0}, \&qstr_add, $self);
                return;
        }
+       chomp(@argv) and $self->qerr("# trailing `\\n' removed");
        $mset_opt{q_raw} = [ @argv ]; # copy
        $mset_opt{qstr} =
                $self->{lse}->query_argv_to_string($self->{lse}->git, \@argv);