Re: [PATCH v2] jobs: Handle string-based job descriptors

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

 



On Mon, 6 Jun 2016 22:45:27 +0800, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
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 <steve@xxxxxxx>  
> 
> 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: pgpZIUWnx6r89.pgp
Description: OpenPGP digital signature


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux