#At file:///usr/home/serg/Abk/mysql/azalea/ based on revid:serg@stripped
2837 Sergei Golubchik 2009-07-29
my_getopt: support options with id==0
modified:
mysys/my_getopt.c
=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c 2009-06-25 14:09:38 +0000
+++ b/mysys/my_getopt.c 2009-07-29 17:00:15 +0000
@@ -466,9 +466,9 @@ invalid value '%s'",
for (optend= cur_arg; *optend; optend++)
{
opt_found= 0;
- for (optp= longopts; optp->id; optp++)
+ for (optp= longopts; optp->name; optp++)
{
- if (optp->id == (int) (uchar) *optend)
+ if (optp->id && optp->id == (int) (uchar) *optend)
{
/* Option recognized. Find next what to do with it */
opt_found= 1;
@@ -622,7 +622,7 @@ static char *check_struct_option(char *c
Will set the option value to given value
*/
-static int setval(const struct my_option *opts, uchar* *value, char *argument,
+static int setval(const struct my_option *opts, uchar **value, char *argument,
my_bool set_maximum_value)
{
int err= 0;
@@ -1150,9 +1150,9 @@ void my_print_help(const struct my_optio
const char *line_end;
const struct my_option *optp;
- for (optp= options; optp->id; optp++)
+ for (optp= options; optp->name; optp++)
{
- if (optp->id < 256)
+ if (optp->id && optp->id < 256)
{
printf(" -%c%s", optp->id, strlen(optp->name) ? ", " : " ");
col= 6;
@@ -1238,7 +1238,7 @@ void my_print_variables(const struct my_
printf("\nVariables (--variable-name=value)\n");
printf("and boolean options {FALSE|TRUE} Value (after reading options)\n");
printf("--------------------------------- -----------------------------\n");
- for (optp= options; optp->id; optp++)
+ for (optp= options; optp->name; optp++)
{
uchar* *value= (optp->var_type & GET_ASK_ADDR ?
(*getopt_get_addr)("", 0, optp, 0) : optp->value);
Attachment: [text/bzr-bundle] bzr/serg@mysql.com-20090729170015-ujgz1mnisc7rhw8q.bundle
| Thread |
|---|
| • bzr commit into mysql-5.4 branch (serg:2837) | Sergei Golubchik | 29 Jul |