Handle maxnum=0 the same way as in mu server.

This commit is contained in:
Titus von der Malsburg 2013-09-27 19:56:20 +02:00
parent 86e6c6c693
commit 3dfcb8ec3e
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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;