diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-15 22:50:59 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-15 22:50:59 +0100 |
commit | 271fed41061e25faa47b7a28108cf101ebb3551d (patch) | |
tree | 733bf84d468a1d47c71c87cfcee33098a090e3c5 /mysys | |
parent | ff26d93a8c25d667709180ad13a090309631990d (diff) | |
parent | e1385f2083f782d7064db3c0059fcca45bfcb2a4 (diff) | |
download | mariadb-git-271fed41061e25faa47b7a28108cf101ebb3551d.tar.gz |
Merge branch '5.5' into 10.0
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_wincond.c | 3 | ||||
-rw-r--r-- | mysys/string.c | 17 |
5 files changed, 14 insertions, 12 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index eb0c252edb1..0699f5d49fe 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 8faee000a6a..d1fbcb8f865 100644 --- a/mysys/my_default.c +++ b/mysys/my_default.c @@ -577,6 +577,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_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; } |