summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-29 00:16:15 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-29 00:16:15 +0300
commit370016677af391c58c03a0eca198936b3ac5d382 (patch)
tree4ad1a20d59a1252f985bb184bc8e51fc1988c045 /mysys/my_getopt.c
parent7311cbe7dee5980d921ec43177fd268783eb18e2 (diff)
downloadmariadb-git-370016677af391c58c03a0eca198936b3ac5d382.tar.gz
Added support for semaphores in mysys.
(Needed for query cache for systems which doesn't have native semaphores) mysys/my_getopt.c: Safety fix. mysys/my_winsem.c: Shange all semaphore code to be uniform mysys/thr_rwlock.c: cleanup sql/gen_lex_hash.cc: Error message if wrong number of arguments. sql/slave.cc: R
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index ce9006e03c0..9583b5a72c3 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -75,7 +75,7 @@ int handle_options(int *argc, char ***argv,
uint opt_found, argvpos= 0, length, i;
my_bool end_of_options= 0, must_be_var, set_maximum_value, special_used,
option_is_loose;
- char *progname= *(*argv), **pos, *optend, *prev_found;
+ char *progname= *(*argv), **pos, **pos_end, *optend, *prev_found;
const struct my_option *optp;
int error;
@@ -84,7 +84,7 @@ int handle_options(int *argc, char ***argv,
(*argv)++; /* --- || ---- */
init_variables(longopts);
- for (pos= *argv; *pos; pos++)
+ for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
char *cur_arg= *pos;
if (cur_arg[0] == '-' && cur_arg[1] && !end_of_options) /* must be opt */