This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Support run bug-setlocale1 directly


> -      newargv[1] = (char *) "--library-path";
> -      newargv[2] = argv[1];
> -      newargv[3] = argv[0];
> -      newargv[4] = NULL;
> +
> +      if (argc == 2)
> +	{
> +	  newargv[0] = argv[0];
> +	  newargv[1] = NULL;
> +	}
> +      else
> +	{
> +	  newargv[0] = argv[1];
> +	  newargv[1] = argv[2];
> +	  newargv[2] = argv[3];
> +	  newargv[3] = argv[4];
> +	  newargv[4] = NULL;
> +	}

Use either a loop or memcpy to make this less repetitive.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]