Re: [PATCH 06/11] built-in add -i: implement the main loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeff,

On Thu, 18 Apr 2019, Jeff Hostetler wrote:

> On 4/10/2019 1:37 PM, Johannes Schindelin via GitGitGadget wrote:
>
> > [...]
> > +
> > +/*
> > + * Returns the selected index.
> > + */
> > +static ssize_t list_and_choose(struct item **items, size_t nr,
> > +			       struct list_and_choose_options *opts)
> > +{
> > +	struct strbuf input = STRBUF_INIT;
> > +	ssize_t res = -1;
> > +
> > +	for (;;) {
> > +		char *p, *endp;
> > +
> > +		strbuf_reset(&input);
> > +
> > +		list(items, nr, &opts->list_opts);
> > +
> > +		printf("%s%s", opts->prompt, "> ");
> > +		fflush(stdout);
> > +
> > +		if (strbuf_getline(&input, stdin) == EOF) {
> > +			putchar('\n');
> > +			res = -2;
>
> It would be nice to know what -1 and -2 mean if
> they get returned to our caller.  Maybe a #define
> for these??

Makes a total lot of sense. I changed that.

Thanks!
Dscho




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux