svn commit: r193223 - head/bin/sh

Julian Elischer julian at elischer.org
Mon Jun 1 18:06:59 UTC 2009


Dag-Erling Smørgrav wrote:
> "M. Warner Losh" <imp at bsdimp.com> writes:
>> : @@ -187,7 +187,8 @@ padvance(char **path, char *name)
>> :  	if (*path == NULL)
>> :  		return NULL;
>> :  	start = *path;
>> : -	for (p = start ; *p && *p != ':' && *p != '%' ; p++);
>> : +	for (p = start; *p && *p != ':' && *p != '%'; p++)
>> : +		; /* nothing */
>>
>> C already has a way of saying this:
>>
>> 	for (p = start; *p && *p != ':' && *p != '%'; p++)
>> 		contionue;
> 
> It's a matter of taste.  There is plenty of precedent for
> 
>         /* nothing */ ;
> 
> and some for
> 
>         ; /* nothing */
> 
> (for varying spellings of "nothing") in the tree.
> 
> DES


and just for bikeshed's sake, In non BSD code I prefer
for (p = start; *p && *p != ':' && *p != '%'; p++)
	{ /* Nothing */ }

for (p = start; *p && *p != ':' && *p != '%'; p++) {
  /* Nothing extra */
}


More information about the svn-src-head mailing list