summaryrefslogtreecommitdiff
path: root/mysys/my_getopt.c
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2008-11-19 13:57:23 +0400
committerAlexey Botchkov <holyfoot@mysql.com>2008-11-19 13:57:23 +0400
commit4d3f05b09b4fa5e4cf7c77c2222fd6513e772f36 (patch)
tree071816ae207f688b1ce7cd2f417f46f05d90aad8 /mysys/my_getopt.c
parent6db425ab4cd2fbd069977336144e99651211ef64 (diff)
downloadmariadb-git-4d3f05b09b4fa5e4cf7c77c2222fd6513e772f36.tar.gz
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
That's a Win-specific error. When we create libmysqld.dll we have many libraries like mysys, dbug, strings, etc linked into that dll, so the application built upon this library shouldn't link these libraries to itself, rather use those inside the dll. Fixed by redirecting calls into the libmysqld.dll per-file comments: dbug/dbug.c Bug#38293 Libmysqld crash in mysql_library_init if language file missing fake _db_something definitions added include/my_dbug.h Bug#38293 Libmysqld crash in mysql_library_init if language file missing fake _db_something declarations added libmysqld/examples/CMakeLists.txt Bug#38293 Libmysqld crash in mysql_library_init if language file missing superfluous libraries removed from linking libmysqld/libmysqld.def Bug#38293 Libmysqld crash in mysql_library_init if language file missing set of mysys functions added to the export section
Diffstat (limited to 'mysys/my_getopt.c')
-rw-r--r--mysys/my_getopt.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 6a7ee748930..0f8055860d4 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -397,9 +397,10 @@ invalid value '%s'",
my_progname, optp->name, optend);
continue;
}
- get_one_option(optp->id, optp,
- *((my_bool*) value) ?
- (char*) "1" : disabled_my_option);
+ if (get_one_option(optp->id, optp,
+ *((my_bool*) value) ?
+ (char*) "1" : disabled_my_option))
+ return EXIT_ARGUMENT_INVALID;
continue;
}
argument= optend;
@@ -457,7 +458,8 @@ invalid value '%s'",
optp->arg_type == NO_ARG)
{
*((my_bool*) optp->value)= (my_bool) 1;
- get_one_option(optp->id, optp, argument);
+ if (get_one_option(optp->id, optp, argument))
+ return EXIT_UNSPECIFIED_ERROR;
continue;
}
else if (optp->arg_type == REQUIRED_ARG ||
@@ -476,7 +478,8 @@ invalid value '%s'",
{
if (optp->var_type == GET_BOOL)
*((my_bool*) optp->value)= (my_bool) 1;
- get_one_option(optp->id, optp, argument);
+ if (get_one_option(optp->id, optp, argument))
+ return EXIT_UNSPECIFIED_ERROR;
continue;
}
/* Check if there are more arguments after this one */
@@ -501,7 +504,8 @@ invalid value '%s'",
my_progname, argument, optp->name);
return error;
}
- get_one_option(optp->id, optp, argument);
+ if (get_one_option(optp->id, optp, argument))
+ return EXIT_UNSPECIFIED_ERROR;
break;
}
}
@@ -524,7 +528,8 @@ invalid value '%s'",
my_progname, argument, optp->name);
return error;
}
- get_one_option(optp->id, optp, argument);
+ if (get_one_option(optp->id, optp, argument))
+ return EXIT_UNSPECIFIED_ERROR;
(*argc)--; /* option handled (short or long), decrease argument count */
}