[RFC PATCH 2/3] cli: add support for limiting the number of search results

Daniel Schoepe daniel at schoepe.org
Sat Oct 29 10:30:50 PDT 2011


On Fri, 28 Oct 2011 23:59:30 +0300, Jani Nikula <jani at nikula.org> wrote:
> @@ -412,6 +413,14 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
>  		fprintf (stderr, "Invalid value for --sort: %s\n", opt);
>  		return 1;
>  	    }
> +	} else if (STRNCMP_LITERAL (argv[i], "--maxitems=") == 0) {
> +	    const char *p;
> +	    opt = argv[i] + sizeof ("--maxitems=") - 1;
> +	    maxitems = strtoul(opt, &p, 10);

p should be of type `char *', not `const char *', as it will be
modified by strtoul. (Otherwise, gcc will produce a warning about this).

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20111029/0d510152/attachment.pgp>


More information about the notmuch mailing list