From: Paul Eggert Date: Wed, 17 Nov 2004 01:52:35 +0000 (+0000) Subject: (POSIXLY_CORRECT): New constant. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d60dc8a48499fb8c4e82414fce3edad7dfd1861;p=pspp (POSIXLY_CORRECT): New constant. --- diff --git a/lib/getopt.c b/lib/getopt.c index 744f115631..ef790b79e0 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -1154,10 +1154,19 @@ _getopt_internal (int argc, char **argv, const char *optstring, return result; } +/* glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if _LIBC +enum { POSIXLY_CORRECT = 0 }; +#else +enum { POSIXLY_CORRECT = 1 }; +#endif + int getopt (int argc, char *const *argv, const char *optstring) { - return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, 1); + return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, + POSIXLY_CORRECT); }