[BusyBox] Re: busybox-cvs Digest, Vol 7, Issue 3

Vladimir N. Oleynik dzo at simtreas.ru
Fri Oct 3 12:47:28 UTC 2003


Glenn,

> Message: 1
> Date: Fri, 03 Oct 2003 03:25:33 +0000
> From: Glenn McGrath <bug1 at busybox.net>
> Subject: [BusyBox-cvs] busybox/applets busybox.c,1.139,1.140
> To: busybox-cvs at busybox.net
> Message-ID: <20031003032534.D35BE157566 at mail.codepoet.org>
> 
> Update of /var/cvs/busybox/applets
> In directory winder:/tmp/cvs-serv376/applets
> 
> Modified Files:
> 	busybox.c 
> Log Message:
> Patch from Rob Landley, Simplify organisation of arguments.
> 
> 
> Index: busybox.c
> ===================================================================
> RCS file: /var/cvs/busybox/applets/busybox.c,v
> retrieving revision 1.139
> retrieving revision 1.140
> diff -u -d -r1.139 -r1.140
> --- busybox.c	19 Mar 2003 09:11:13 -0000	1.139
> +++ busybox.c	3 Oct 2003 03:25:30 -0000	1.140
> @@ -98,7 +98,7 @@
>  
>  int busybox_main(int argc, char **argv)
>  {
> -	int col = 0, len, i;
> +	int col = 0;
>  
>  #ifdef CONFIG_FEATURE_INSTALLER	
>  	/* 
> @@ -161,18 +161,7 @@
>  	/* Flag that we've been here already */
>  	been_there_done_that = 1;
>  	
> -	/* Move the command line down a notch */
> -	len = argv[argc] + strlen(argv[argc]) - argv[1];
> -	memmove(argv[0], argv[1], len);
> -	memset(argv[0] + len, 0, argv[1] - argv[0]);
> -
> -	/* Fix up the argv pointers */
> -	len = argv[1] - argv[0];
> -	memmove(argv, argv + 1, sizeof(char *) * (argc + 1));
> -	for (i = 0; i < argc; i++)
> -		argv[i] -= len;
> -
> -	return (main(argc, argv));
> +	return (main(argc-1, argv+1));
>  }

Why? This code make setproctitle() correction. Erik not approved this also.


--w
vodz




More information about the busybox mailing list