summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXfennec <xfennec@cqfd-corp.org>2016-01-22 17:03:21 +0100
committerXfennec <xfennec@cqfd-corp.org>2016-01-22 17:03:21 +0100
commit5d8db0f6dbd501cbb6f023b72e7600579eda3885 (patch)
tree870d4f8418f4df3d949ca338a1661252491cfea1
parentba3bec9e64e62e6f8ac735842a3a0bf79f7c6bce (diff)
Reseting optind before parsing PROGRESS_ARGS (related to issue #69 and probably #68)v0.11
-rw-r--r--progress.c7
-rw-r--r--progress.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/progress.c b/progress.c
index 15bf34c..c910ec3 100644
--- a/progress.c
+++ b/progress.c
@@ -480,6 +480,13 @@ int c,i;
int option_index = 0;
char *rp;
+printf("argc=%d\n", argc);
+for (i = 0 ; i < argc ; i++)
+ printf("[%s] ", argv[i]);
+printf("\n\n");
+
+optind = 1; // reset getopt
+
while(1) {
c = getopt_long (argc, argv, options_string, long_options, &option_index);
diff --git a/progress.h b/progress.h
index fc5c1dd..b31046c 100644
--- a/progress.h
+++ b/progress.h
@@ -25,7 +25,7 @@
#include "hlist.h"
-#define PROGRESS_VERSION "0.10"
+#define PROGRESS_VERSION "0.11"
#define PROC_PATH "/proc"
#define MAX_PIDS 32