[uClinux-dev] [patch] - ucfront tool

Greg Ungerer gerg at snapgear.com
Wed Aug 31 10:43:42 EDT 2005


Hi John,

John Williams wrote:
> Attached is a patch on ucfront.c, for hopeful inclusion in next dist-test :)
> 
> It's just a minor tweak on my previously submitted support for the
> UCFRONT_LINK_SUFFIX env. var.  It has proven necessary to tokenise the
> string rather than just inserting it in the list, in case multiple
> options are specified.

Applied.

Regards
Greg



> ------------------------------------------------------------------------
> 
> Index: ucfront.c
> ===================================================================
> --- ucfront.c	(.../vendor/uClinux-dist/current/tools/ucfront/ucfront.c)	(revision 66)
> +++ ucfront.c	(.../trunk/software/linux/uClinux-dist/tools/ucfront/ucfront.c)	(working copy)
> @@ -722,10 +722,24 @@
>  	/* Hack by JW to allow forcing specific args right at the 
>  	   end of the stripped arg list.  This works around cruftiness
>  	   in mb-gcc-2.95.x, however it may be useful somewhere else */
> -	if((e=getenv("UCFRONT_LINK_SUFFIX")) && (mode==MODE_LINK) ) {
> -		args_add(stripped_args,e);
> +	if((e=getenv("UCFRONT_LINK_SUFFIX")) && (mode==MODE_LINK) ) 
> +	{
> +		/* Break up potentially multiple words into substrings */
> +		char *p1;
> +
> +		/* Duplicate the string - strtok messes with it */
> +		char *e2=(char *)malloc(strlen(e)+1);
> +		strcpy(e2,e);
> +
> +		p1=strtok(e2," ");
> +
> +		while(p1)
> +		{
> +			args_add(stripped_args,p1);
> +			p1=strtok(NULL," ");
> +		}
> +		free(e2);
>  	}
> -
>  }
>  
>  /* the main ucfront driver function */
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg at snapgear.com
SnapGear -- a CyberGuard Company            PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com



More information about the uClinux-dev mailing list