This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/3] Support run bug-setlocale1 directly
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 10 Jan 2013 11:49:55 -0800 (PST)
- Subject: Re: [PATCH 2/3] Support run bug-setlocale1 directly
- References: <20121221005321.GB25282@intel.com>
> - 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.