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)
|
if (opts->threads)
|
||||||
qflags |= MU_QUERY_FLAG_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;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,7 +598,7 @@ output_query_results (MuMsgIter *iter, MuConfig *opts, GError **err)
|
||||||
|
|
||||||
MuMsg *msg;
|
MuMsg *msg;
|
||||||
|
|
||||||
if (opts->maxnum > 0 && count == opts->maxnum)
|
if (count == opts->maxnum)
|
||||||
break;
|
break;
|
||||||
msg = get_message (iter, opts->after);
|
msg = get_message (iter, opts->after);
|
||||||
if (!msg)
|
if (!msg)
|
||||||
|
|
|
@ -704,6 +704,8 @@ mu_config_init (int *argcp, char ***argvp, GError **err)
|
||||||
|
|
||||||
memset (&MU_CONFIG, 0, sizeof(MU_CONFIG));
|
memset (&MU_CONFIG, 0, sizeof(MU_CONFIG));
|
||||||
|
|
||||||
|
MU_CONFIG.maxnum = -1; /* By default, output all matching entries. */
|
||||||
|
|
||||||
if (!parse_cmd (argcp, argvp, err))
|
if (!parse_cmd (argcp, argvp, err))
|
||||||
goto errexit;
|
goto errexit;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue