diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/lf_hash.c | 3 | ||||
-rw-r--r-- | mysys/my_default.c | 1 | ||||
-rw-r--r-- | mysys/my_gethwaddr.c | 2 | ||||
-rw-r--r-- | mysys/my_rnd.c | 4 | ||||
-rw-r--r-- | mysys/my_wincond.c | 3 | ||||
-rw-r--r-- | mysys/string.c | 17 |
6 files changed, 14 insertions, 16 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 10fe5ae40c4..6be11edbfcf 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. + Copyright (c) 2009, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysys/my_default.c b/mysys/my_default.c index 0ce01960630..34ba9eef218 100644 --- a/mysys/my_default.c +++ b/mysys/my_default.c @@ -576,6 +576,7 @@ int my_load_defaults(const char *conf_file, const char **groups, handle_default_option, (void *) &ctx, dirs))) { + delete_dynamic(&args); free_root(&alloc,MYF(0)); DBUG_RETURN(error); } diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c index 208f2ff902a..0fad7f90552 100644 --- a/mysys/my_gethwaddr.c +++ b/mysys/my_gethwaddr.c @@ -72,7 +72,7 @@ err: return res; } -#elif defined(__linux__) || defined(__sun__) +#elif defined(__linux__) || defined(__sun) #include <net/if.h> #include <sys/ioctl.h> #include <net/if_arp.h> diff --git a/mysys/my_rnd.c b/mysys/my_rnd.c index 14f212e2f32..ad7bda0b42b 100644 --- a/mysys/my_rnd.c +++ b/mysys/my_rnd.c @@ -95,7 +95,3 @@ double my_rnd_ssl(struct my_rnd_struct *rand_st) return my_rnd(rand_st); } - -#ifdef __cplusplus -} -#endif diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c index c761064dd96..07ba4f5c587 100644 --- a/mysys/my_wincond.c +++ b/mysys/my_wincond.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. + Copyright (c) 2011, 2016, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysys/string.c b/mysys/string.c index cc73d18c601..a0fa3a02e17 100644 --- a/mysys/string.c +++ b/mysys/string.c @@ -142,16 +142,16 @@ my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n) my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) { #ifdef __WIN__ - const char *quote_str= "\""; - const uint quote_len= 1; + LEX_CSTRING quote= { C_STRING_WITH_LEN("\"") }; + LEX_CSTRING replace= { C_STRING_WITH_LEN("\\\"") }; #else - const char *quote_str= "\'"; - const uint quote_len= 1; + LEX_CSTRING quote= { C_STRING_WITH_LEN("\'") }; + LEX_CSTRING replace= { C_STRING_WITH_LEN("'\"'\"'") }; #endif /* __WIN__ */ my_bool ret= TRUE; va_list dirty_text; - ret&= dynstr_append_mem(str, quote_str, quote_len); /* Leading quote */ + ret&= dynstr_append_mem(str, quote.str, quote.length); /* Leading quote */ va_start(dirty_text, append); while (append != NullS) { @@ -159,18 +159,17 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) const char *next_pos= cur_pos; /* Search for quote in each string and replace with escaped quote */ - while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0') + while(*(next_pos= strcend(cur_pos, quote.str[0])) != '\0') { ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos)); - ret&= dynstr_append_mem(str ,"\\", 1); - ret&= dynstr_append_mem(str, quote_str, quote_len); + ret&= dynstr_append_mem(str, replace.str, replace.length); cur_pos= next_pos + 1; } ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos)); append= va_arg(dirty_text, char *); } va_end(dirty_text); - ret&= dynstr_append_mem(str, quote_str, quote_len); /* Trailing quote */ + ret&= dynstr_append_mem(str, quote.str, quote.length); /* Trailing quote */ return ret; } |