Browse Source

Fix optind initialization while opt parsing

git-svn-id: https://klish.googlecode.com/svn/trunk@589 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 12 years ago
parent
commit
eb0379fe22
4 changed files with 4 additions and 4 deletions
  1. 1 1
      bin/clish.cpp
  2. 1 1
      bin/konf.c
  3. 1 1
      bin/konfd.c
  4. 1 1
      konf/query/query.c

+ 1 - 1
bin/clish.cpp

@@ -119,7 +119,7 @@ int main(int argc, char **argv)
 	cmds = lub_list_new(NULL);
 
 	/* Parse command line options */
-	optind = 0;
+	optind = 1;
 	while(1) {
 		int opt;
 #ifdef HAVE_GETOPT_H

+ 1 - 1
bin/konf.c

@@ -72,7 +72,7 @@ int main(int argc, char **argv)
 	sigaction(SIGPIPE, &sigpipe_act, NULL);
 
 	/* Parse command line options */
-	optind = 0;
+	optind = 1;
 	while(1) {
 		int opt;
 #ifdef HAVE_GETOPT_H

+ 1 - 1
bin/konfd.c

@@ -572,7 +572,7 @@ static int opts_parse(int argc, char *argv[], struct options *opts)
 		{NULL,		0, NULL, 0}
 	};
 #endif
-	optind = 0;
+	optind = 1;
 	while(1) {
 		int opt;
 #ifdef HAVE_GETOPT_H

+ 1 - 1
konf/query/query.c

@@ -107,7 +107,7 @@ int konf_query_parse(konf_query_t *this, int argc, char **argv)
 	};
 #endif
 
-	optind = 0;
+	optind = 1;
 	while(1) {
 		int opt;
 #ifdef HAVE_GETOPT_H