projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated
[gnulib.git]
/
lib
/
getopt.c
diff --git
a/lib/getopt.c
b/lib/getopt.c
index
744f115
..
ef790b7
100644
(file)
--- a/
lib/getopt.c
+++ b/
lib/getopt.c
@@
-1154,10
+1154,19
@@
_getopt_internal (int argc, char **argv, const char *optstring,
return result;
}
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)
{
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);
}
\f
}
\f