In BSD getopt we need to set variable "optreset" to 1 if we are going to call
authorRoman Bogorodskiy <mirrorbox@users.sourceforge.net>
Wed, 24 Aug 2005 12:05:47 +0000 (12:05 +0000)
committerRoman Bogorodskiy <mirrorbox@users.sourceforge.net>
Wed, 24 Aug 2005 12:05:47 +0000 (12:05 +0000)
getopt() for the second time.

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@162 7f574dfc-610e-0410-a909-a81674777703

src/conky.c

index bb6c036..dc0bc16 100644 (file)
@@ -4298,8 +4298,12 @@ int main(int argc, char **argv)
 
        /* handle other command line arguments */
 
+#if defined(__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__)
+       optind = optreset = 1;
+#else
        optind = 0;
-
+#endif
+       
        while (1) {
                int c = getopt(argc,
                               argv,