summaryrefslogtreecommitdiff
path: root/codec/compat
diff options
context:
space:
mode:
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2007-12-10 13:16:01 +0000
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2007-12-10 13:16:01 +0000
commit26606c71c8a5c3a79f9e371e1c0ddfcb800b77df (patch)
treea44d6c989e1e143b8420b737b0aa46745bcdca34 /codec/compat
parente06bcd027f860f2d62c5419dab14a975eecae7c9 (diff)
First import of JAVAOpenJPEG, a Java wrapper of OpenJPEG, developed by Patrick Piscaglia of Telemis (www.telemis.com). Thank you Patrick for this new module !
Diffstat (limited to 'codec/compat')
-rw-r--r--codec/compat/getopt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/codec/compat/getopt.c b/codec/compat/getopt.c
index 23270e6a..f434924b 100644
--- a/codec/compat/getopt.c
+++ b/codec/compat/getopt.c
@@ -59,7 +59,11 @@ typedef struct option
#define BADARG (int)':'
#define EMSG ""
-
+/* As this class remembers its values from one Java call to the other, reset the values before each use */
+void reset_options_reading() {
+ opterr = 1;
+ optind = 1;
+}
/*
* getopt --
@@ -132,7 +136,7 @@ struct option *longopts, int totlen) {
char param = 1;
again:
- if (optind>argc || !argv[optind] || *argv[optind]!='-')
+ if (optind >= argc || !argv[optind] || *argv[optind]!='-')
return -1;
if (argv[optind][0]=='-' && argv[optind][1]==0) {