[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATH] sysctl: 'sysctl_dots_to_slashes' does not give calmness
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-03-27 4:03:24
Message-ID: 201003270503.24415.vda.linux () googlemail ! com
[Download RAW message or body]

Hi Maks!

On Thursday 25 March 2010 11:59, Maxim Kryžanovský wrote:
> Hi Denis,
> 
> it is small thing, but IMHO, we can remove line with "if (cptr != end)"
> or "*end = '\0';" and retain only one of them. The first has precedence.

> 	*end = '.';
>  again:
> 	cptr = end;
> 	while (cptr > last_good) {
> 		if (*cptr == '.') {
> 			*cptr = '\0';
> 			if (access(name, F_OK) == 0) {
> 				if (cptr != end) /* prevent trailing '/' by *end = '\0'; at the end of the loop */
> 					*cptr = '/';
> 				last_good = cptr;
> 				goto again;
> 			}
> 			*cptr = '.';
> 		}
> 		cptr--;
> 	}
> 	*end = '\0'; /*  prevents trailing '/' */

Yes. Applied, thanks!

-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic