summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Galarza <iggy@mysql.com>2009-08-06 10:24:28 -0400
committerIgnacio Galarza <iggy@mysql.com>2009-08-06 10:24:28 -0400
commit1c07007f0644b5579065edb3a3380d290028fd7a (patch)
tree4b35f72d52bbe22b1102832b3a09c62261ef658d
parent77acccc21fd4e95811757d95788d711fff45c586 (diff)
downloadmariadb-git-1c07007f0644b5579065edb3a3380d290028fd7a.tar.gz
Bug #27535 Installing Windows service with --defaults-file option - quotation marks issues
- Remove offensive quotes.
-rw-r--r--sql/mysqld.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 37b3754d716..afbbf753813 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4006,15 +4006,28 @@ default_service_handling(char **argv,
const char *account_name)
{
char path_and_service[FN_REFLEN+FN_REFLEN+32], *pos, *end;
+ const char *opt_delim;
end= path_and_service + sizeof(path_and_service)-3;
/* We have to quote filename if it contains spaces */
pos= add_quoted_string(path_and_service, file_path, end);
if (*extra_opt)
{
- /* Add (possible quoted) option after file_path */
+ /*
+ Add option after file_path. There will be zero or one extra option. It's
+ assumed to be --defaults-file=file but isn't checked. The variable (not
+ the option name) should be quoted if it contains a string.
+ */
*pos++= ' ';
- pos= add_quoted_string(pos, extra_opt, end);
+ if (opt_delim= strchr(extra_opt, '='))
+ {
+ size_t length= ++opt_delim - extra_opt;
+ strnmov(pos, extra_opt, length);
+ }
+ else
+ opt_delim= extra_opt;
+
+ pos= add_quoted_string(pos, opt_delim, end);
}
/* We must have servicename last */
*pos++= ' ';