diff options
Diffstat (limited to 'mysys/default.c')
-rw-r--r-- | mysys/default.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/mysys/default.c b/mysys/default.c index cdacc8bee2b..9f7181b7da9 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -173,7 +173,6 @@ void load_defaults(const char *conf_file, const char **groups, res= (char**) (ptr+sizeof(alloc)); /* copy name + found arguments + command line arguments to new array */ - res[0]=argv[0][0]; memcpy((gptr) (res+1), args.buffer, args.elements*sizeof(char*)); /* Skipp --defaults-file and --defaults-extra-file */ (*argc)-= args_used; @@ -186,8 +185,9 @@ void load_defaults(const char *conf_file, const char **groups, --*argc; ++*argv; /* skipp argument */ } - memcpy((gptr) (res+1+args.elements), (char*) ((*argv)+1), - (*argc-1)*sizeof(char*)); + if (*argc) + memcpy((gptr) (res+1+args.elements), (char*) ((*argv)+1), + (*argc-1)*sizeof(char*)); res[args.elements+ *argc]=0; /* last null */ (*argc)+=args.elements; @@ -269,7 +269,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, { line++; /* Ignore comment and empty lines */ - for (ptr=buff ; isspace(*ptr) ; ptr++ ) ; + for (ptr=buff ; my_isspace(&my_charset_latin1,*ptr) ; ptr++ ) ; if (*ptr == '#' || *ptr == ';' || !*ptr) continue; if (*ptr == '[') /* Group name */ @@ -282,7 +282,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, name,line); goto err; } - for ( ; isspace(end[-1]) ; end--) ; /* Remove end space */ + for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;/* Remove end space */ end[0]=0; read_values=find_type(ptr,group,3) > 0; continue; @@ -299,8 +299,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, end= remove_end_comment(ptr); if ((value= strchr(ptr, '='))) end= value; /* Option without argument */ - for ( ; isspace(end[-1]) ; end--) ; - + for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ; if (!value) { if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3))) @@ -313,9 +312,9 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, { /* Remove pre- and end space */ char *value_end; - for (value++ ; isspace(*value); value++) ; + for (value++ ; my_isspace(&my_charset_latin1,*value); value++) ; value_end=strend(value); - for ( ; isspace(value_end[-1]) ; value_end--) ; + for ( ; my_isspace(&my_charset_latin1,value_end[-1]) ; value_end--) ; if (value_end < value) /* Empty string */ value_end=value; if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3 + |