RE: [PATCH] whereis: move token assignment into loop syntax

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

 



Davidlohr Bueso wrote:

> ... use for() naturally instead.

> -	for (tmp = pathcp; ; tmp = NULL) {
> -		tok = strtok_r(tmp, ":", &key);
> -		if (!tok)
> -			break;
> -
> +	for (tmp = pathcp; tok = strtok_r(tmp, ":", &key); tmp = NULL) {
>  		/* make sure we don't repeat the search path */
>  		if (inpath(tok))
>  			continue;

hmm, a repetitive assignment like "tmp = NULL" as the increment
expression of the for-loop doesn't read too natural for me either.
;-)

Have a nice day,
Berny--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux