X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgetopt.c;h=bcb81c83fe25da1e9c01b0a6347f5ce836a68960;hb=41f33021bba216bf24c5d93951fbede15390ea92;hp=744f1156311593ada1deb34bcd1705ca2d787558;hpb=06ee59a585b78f1071e246c1a8c3e0d3731388b0;p=gnulib.git diff --git a/lib/getopt.c b/lib/getopt.c index 744f11563..bcb81c83f 100644 --- 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, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ @@ -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); }