cvs commit: ALFS/nALFS/src/handlers remove.c

Kevin P. Fleming kpfleming at linuxfromscratch.org
Fri Jan 30 13:31:46 PST 2004


jamie at linuxfromscratch.org wrote:

>   +        	if ((status = execute_command("rm -fr %s", name))) {
>   +            		Nprint_h_err("Removing failed.");
>   +            		status = -1;
>   +            		break;
>   +	    	}
>   +
>   +		xfree(name);
>   +    	}
>   +
>   +	xfree(name);

Looks nice Jamie, but I'd suggest adding a comment above this last 
xfree(name) documenting that it's necessary because the loop above might 
stop due to the break statement before the xfree(name) inside the loop 
can be executed. Granted anyone reading the code should be able to 
figure that out, but since it's not obvious why the line is duplicated 
we can help them a little :-)




More information about the alfs-log mailing list