1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge of mysql-5.1-bugteam into mysql-trunk-merge.

This commit is contained in:
Davi Arnaut
2010-07-02 16:38:04 -03:00
60 changed files with 260 additions and 365 deletions

View File

@@ -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))
{