On Mon, 6 Jun 2016 22:45:27 +0800, Herbert Xu <herb...@gondor.apana.org.au>
wrote:
> On Fri, Jun 03, 2016 at 09:54:31AM +0200, Stephen Kitt wrote:
> > When looking for a job using a string descriptor, e.g.
> > 
> >     fg %man
> > 
> > the relevant loop in src/jobs.c only ever exits to the err label. With
> > this patch, when the end condition is reached, we check whether a job
> > was found, and if so, set things up to exit correctly via gotit.
> > Multiple matches are already caught using the test in the match block.
> > 
> > Signed-off-by: Stephen Kitt <st...@sk2.org>  
> 
> Thanks for the patch.  I'd prefer to move that logic out of the
> loop, like this:
[...]

> -     while (1) {
> -             if (!jp)
> -                     goto err;
> +     while (jp) {
[...]

That is indeed much better, thanks!

Regards,

Stephen

Attachment: pgpJITcLL_dmj.pgp
Description: OpenPGP digital signature

Reply via email to