projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* getlogin_r.h: Simplify API documentation.
[gnulib.git]
/
lib
/
getopt.c
diff --git
a/lib/getopt.c
b/lib/getopt.c
index
744f115
..
bcb81c8
100644
(file)
--- a/
lib/getopt.c
+++ b/
lib/getopt.c
@@
-18,7
+18,7
@@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
- Inc., 5
9 Temple Place - Suite 330, Boston, MA 02111-1307
, USA. */
+ Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301
, USA. */
\f
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
\f
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@
-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