]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Revert c849ba32af231fba36f4500d0d3290821f4dd7b7
authorRobert Millan <rmh@aybabtu.com>
Mon, 13 Feb 2006 20:25:22 +0000 (20:25 +0000)
committerGuillem Jover <guillem@hadrons.org>
Tue, 6 May 2008 05:49:44 +0000 (08:49 +0300)
Will use bsd_getopt() wrapper instead.

ChangeLog
Makefile
Versions
reset_getopt.c [deleted file]

index c9dbe63461e0400b80dbbb2f5178a2759d208b31..f33a120d5a263e05da729e72a216e07484a347e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,3 @@
-2006-02-13  Robert Millan  <rmh@aybabtu.com>
-       
-       Add reset_getopt (borrowed from e2fsprogs).
-       * reset_getopt.c: New.
-       * Versions: Add reset_getopt.
-       * Makefile: Add reset_getopt.c.
-       * debian/copyright: Add license (GPL).
-
 2006-02-10  Robert Millan  <rmh@aybabtu.com>
        
        Add errc, warnc, verrc and vwarnc.
index c5c27475f7d33433782b43c72bbc08528fc826c1..51908201977630114c97f65f7225450fd3c7f168 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 # $Id$
 #
 
-LIB_SRCS = arc4random.c err.c fgetln.c inet_net_pton.c reset_getopt.c  strlcat.c strlcpy.c md5c.c fmtcheck.c
+LIB_SRCS = arc4random.c err.c fgetln.c inet_net_pton.c strlcat.c strlcpy.c md5c.c fmtcheck.c
 
 LIB_INCLUDES = include/bsd/err.h include/bsd/ip_icmp.h include/bsd/random.h include/bsd/queue.h include/bsd/md5.h include/bsd/string.h include/bsd/bsd.h include/bsd/stdlib.h
 
index 2b83d5e776a7f26f954ea1d8c1f88c1a733f8638..49e068c3315e7c0b3770814abf796a8b71daeeba 100644 (file)
--- a/Versions
+++ b/Versions
@@ -6,8 +6,8 @@ LIBBSD_0.0 {
     fgetwln;
     fmtcheck;
     inet_net_pton;
-    reset_getopt;
-    strlcpy; strlcat;
+    strlcpy;
+    strlcat;
     MD5Init;
     MD5Update;
     MD5Pad;
diff --git a/reset_getopt.c b/reset_getopt.c
deleted file mode 100644 (file)
index 9e28522..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * util.c --- utilities for the debugfs program
- * 
- * Copyright (C) 1993, 1994 Theodore Ts'o.  This file may be
- * redistributed under the terms of the GNU Public License.
- *
- */
-
-/* Enable getopt variables */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-#include <unistd.h>
-#include <sys/param.h> /* BSD */
-
-#ifdef BSD
-# define HAVE_OPTRESET 1
-#endif
-
-/*
- * This function resets the libc getopt() function, which keeps
- * internal state.  Bad design!  Stupid libc API designers!  No
- * biscuit!
- *
- * BSD-derived getopt() functions require that optind be reset to 1 in
- * order to reset getopt() state.  This used to be generally accepted
- * way of resetting getopt().  However, glibc's getopt()
- * has additional getopt() state beyond optind, and requires that
- * optind be set zero to reset its state.  So the unfortunate state of
- * affairs is that BSD-derived versions of getopt() misbehave if
- * optind is set to 0 in order to reset getopt(), and glibc's getopt()
- * will core ump if optind is set 1 in order to reset getopt().
- * 
- * More modern versions of BSD require that optreset be set to 1 in
- * order to reset getopt().   Sigh.  Standards, anyone?
- *
- * We hide the hair here.
- */
-void
-reset_getopt (void)
-{
-#ifdef __GLIBC__
-  optind = 0;
-#else
-  optind = 1;
-#endif
-#ifdef HAVE_OPTRESET
-  optreset = 1;                        /* Makes BSD getopt happy */
-#endif
-}