summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c51
1 files changed, 4 insertions, 47 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 96f147c26c3..3fe025ba808 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -38,7 +38,7 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err);
static void init_variables(const struct my_option *, init_func_p);
static void init_one_value(const struct my_option *, void *, longlong);
static void fini_one_value(const struct my_option *, void *, longlong);
-static int setval(const struct my_option *, void *, char *, my_bool, const char *);
+static int setval(const struct my_option *, void *, char *, my_bool);
static char *check_struct_option(char *cur_arg, char *key_name);
/*
@@ -133,48 +133,6 @@ double getopt_ulonglong2double(ulonglong v)
return u.dbl;
}
-#ifdef _WIN32
-/**
-
- On Windows, if program is running in UTF8 mode, but some arguments are not UTF8.
-
- This will mostly likely be a sign of old "ANSI" my.ini, and it is likely that
- something will go wrong, e.g file access error.
-*/
-static void validate_value(const char *key, const char *value,
- const char *filename)
-{
- MY_STRCOPY_STATUS status;
- const struct charset_info_st *cs= &my_charset_utf8mb4_bin;
- size_t len;
- if (GetACP() != CP_UTF8)
- return;
- len= strlen(value);
- if (!len)
- return;
- cs->cset->well_formed_char_length(cs, value, value + len, len, &status);
- if (!status.m_well_formed_error_pos)
- return;
-
- if (filename && *filename)
- {
- my_getopt_error_reporter(WARNING_LEVEL,
- "%s: invalid (non-UTF8) characters found for option '%s'"
- " in file '%s'",
- my_progname, key, filename);
- }
- else
- {
- DBUG_ASSERT(0);
- my_getopt_error_reporter(
- WARNING_LEVEL, "%s: invalid (non-UTF8) characters for option %s",
- my_progname, key);
- }
-}
-#else
-#define validate_value(key, value, filename) (void)filename
-#endif
-
/**
Handle command line options.
Sort options.
@@ -606,7 +564,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
}
}
if ((error= setval(optp, optp->value, argument,
- set_maximum_value,filename)))
+ set_maximum_value)))
DBUG_RETURN(error);
if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
@@ -652,7 +610,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
continue;
}
if ((!option_is_autoset) &&
- ((error= setval(optp, value, argument, set_maximum_value,filename))) &&
+ ((error= setval(optp, value, argument, set_maximum_value))) &&
!option_is_loose)
DBUG_RETURN(error);
if (get_one_option(optp, argument, filename))
@@ -753,7 +711,7 @@ static my_bool get_bool_argument(const struct my_option *opts,
*/
static int setval(const struct my_option *opts, void *value, char *argument,
- my_bool set_maximum_value, const char *option_file)
+ my_bool set_maximum_value)
{
int err= 0, res= 0;
DBUG_ENTER("setval");
@@ -900,7 +858,6 @@ static int setval(const struct my_option *opts, void *value, char *argument,
goto ret;
};
}
- validate_value(opts->name, argument, option_file);
DBUG_RETURN(0);
ret: