* mu-query: don't try to print fields which are not in xapian

This commit is contained in:
Dirk-Jan C. Binnema
2009-12-09 00:05:23 +02:00
parent 0dc999ffb2
commit 42a9414242

View File

@ -136,12 +136,12 @@ print_rows (MuQueryXapian *xapian, const gchar *query, MuConfigOptions *opts)
while (*fields) {
const MuMsgField* field =
mu_msg_field_from_shortcut (*fields);
if (!field)
if (!field ||
!mu_msg_field_is_xapian_enabled (field))
printlen += printf ("%c", *fields);
else
printlen += printf ("%s",
display_field(row, field));
++fields;
}
if (printlen >0)
@ -186,12 +186,13 @@ mu_query_run (MuConfigOptions *opts, GSList *args)
rv = MU_OK;
handle_options (opts);
xapian = mu_query_xapian_new (opts->muhome);
xapian = mu_query_xapian_new (opts->muhome);
if (!xapian)
return MU_ERROR;
rv = do_output (xapian, args, opts) ? 0 : 1;
mu_query_xapian_destroy (xapian);
return rv;