diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-02 16:38:04 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-02 16:38:04 -0300 |
commit | 5641fb64b4719774f6c4ba4c1ec85fa5312c5ecf (patch) | |
tree | 3c6e29d5a9d1f0a067dcdf4cca5b5747721aee89 /mysys/my_getopt.c | |
parent | aa4357f3944032ab95137d52342bc7673159fc64 (diff) | |
parent | 0eb26fdfa83d2ddd5f3dc3f8cf6e372a55b4c270 (diff) | |
download | mariadb-git-5641fb64b4719774f6c4ba4c1ec85fa5312c5ecf.tar.gz |
Merge of mysql-5.1-bugteam into mysql-trunk-merge.
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r-- | mysys/my_getopt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 1e94dd2d761..30f4888cd98 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -28,7 +28,7 @@ typedef void (*init_func_p)(const struct my_option *option, void *variable, static void default_reporter(enum loglevel level, const char *format, ...); my_error_reporter my_getopt_error_reporter= &default_reporter; -static int findopt(char *, uint, const struct my_option **, char **); +static int findopt(char *, uint, const struct my_option **, const char **); my_bool getopt_compare_strings(const char *, const char *, uint); static longlong getopt_ll(char *arg, const struct my_option *optp, int *err); static ulonglong getopt_ull(char *, const struct my_option *, int *); @@ -113,8 +113,8 @@ int handle_options(int *argc, char ***argv, uint opt_found, argvpos= 0, length; my_bool end_of_options= 0, must_be_var, set_maximum_value, option_is_loose; - char **pos, **pos_end, *optend, *UNINIT_VAR(prev_found), - *opt_str, key_name[FN_REFLEN]; + char **pos, **pos_end, *optend, *opt_str, key_name[FN_REFLEN]; + const char *UNINIT_VAR(prev_found); const struct my_option *optp; void *value; int error, i; @@ -185,7 +185,6 @@ int handle_options(int *argc, char ***argv, Find first the right option. Return error in case of an ambiguous, or unknown option */ - LINT_INIT(prev_found); optp= longopts; if (!(opt_found= findopt(opt_str, length, &optp, &prev_found))) { @@ -696,10 +695,10 @@ ret: static int findopt(char *optpat, uint length, const struct my_option **opt_res, - char **ffname) + const char **ffname) { uint count; - struct my_option *opt= (struct my_option *) *opt_res; + const struct my_option *opt= *opt_res; for (count= 0; opt->name; opt++) { @@ -710,8 +709,9 @@ static int findopt(char *optpat, uint length, return 1; if (!count) { + /* We only need to know one prev */ count= 1; - *ffname= (char *) opt->name; /* We only need to know one prev */ + *ffname= opt->name; } else if (strcmp(*ffname, opt->name)) { |