mirror of https://github.com/djcb/mu.git
Handle maxnum=0 the same way as in mu server.
This commit is contained in:
parent
86e6c6c693
commit
3dfcb8ec3e
|
@ -132,7 +132,7 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts, GError **err)
|
|||
if (opts->threads)
|
||||
qflags |= MU_QUERY_FLAG_THREADS;
|
||||
|
||||
iter = mu_query_run (xapian, query, sortid, -1, qflags, err);
|
||||
iter = mu_query_run (xapian, query, sortid, opts->maxnum, qflags, err);
|
||||
return iter;
|
||||
}
|
||||
|
||||
|
@ -598,7 +598,7 @@ output_query_results (MuMsgIter *iter, MuConfig *opts, GError **err)
|
|||
|
||||
MuMsg *msg;
|
||||
|
||||
if (opts->maxnum > 0 && count == opts->maxnum)
|
||||
if (count == opts->maxnum)
|
||||
break;
|
||||
msg = get_message (iter, opts->after);
|
||||
if (!msg)
|
||||
|
|
|
@ -704,6 +704,8 @@ mu_config_init (int *argcp, char ***argvp, GError **err)
|
|||
|
||||
memset (&MU_CONFIG, 0, sizeof(MU_CONFIG));
|
||||
|
||||
MU_CONFIG.maxnum = -1; /* By default, output all matching entries. */
|
||||
|
||||
if (!parse_cmd (argcp, argvp, err))
|
||||
goto errexit;
|
||||
|
||||
|
|
Loading…
Reference in New Issue