From 12afe4452794da198bfb969a558fd52ff10649eb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 20 Feb 2004 23:31:47 +0000 Subject: [PATCH] * getopt.c: Avoid useless compiler warnings. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/libc/getopt.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3729f5c02..a0d1c9921 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2004-02-20 Corinna Vinschen + + * getopt.c: Avoid useless compiler warnings. + 2004-02-20 Corinna Vinschen * getopt.c: Replace with latest vanilla(!) OpenBSD version 1.16. diff --git a/winsup/cygwin/libc/getopt.c b/winsup/cygwin/libc/getopt.c index 6079ce350..0ed46310e 100644 --- a/winsup/cygwin/libc/getopt.c +++ b/winsup/cygwin/libc/getopt.c @@ -87,7 +87,11 @@ char *optarg; /* argument associated with option */ #define BADARG ((*options == ':') ? (int)':' : (int)'?') #define INORDER (int)1 +#ifdef __CYGWIN__ +static char EMSG[] = ""; +#else #define EMSG "" +#endif static int getopt_internal(int, char * const *, const char *, const struct option *, int *, int); @@ -421,7 +425,7 @@ start: } if ((optchar = (int)*place++) == (int)':' || - optchar == (int)'-' && *place != '\0' || + (optchar == (int)'-' && *place != '\0') || (oli = strchr(options, optchar)) == NULL) { /* * If the user specified "-" and '-' isn't listed in -- 2.43.5