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

Reply via email to