[klibc] [PATCH] getopt
H. Peter Anvin
hpa at zytor.com
Fri Jan 7 18:42:14 PST 2005
Thayne Harbaugh wrote:
> Patch to guarantee __optptr initialization and to correctly increment
> optind for missing arguments.
static and global variables are always initialized to zero, however,
putting = NULL there will make some gcc versions put them in the .data
segment unnecessarily.
> int getopt(int argc, char * const *argv, const char *optstring)
> {
> @@ -51,6 +51,7 @@
> optind += 2;
> } else {
> /* Missing argument */
> + optind++;
> return (optstring[0] == ':') ? ':' : '?';
> }
> }
Applied. Note that your patch came through base64-encoded.
-hpa
More information about the klibc
mailing list