diff options
author | unknown <msvensson@pilot.blaudden> | 2007-04-19 17:00:29 +0200 |
---|---|---|
committer | unknown <msvensson@pilot.blaudden> | 2007-04-19 17:00:29 +0200 |
commit | 4fff310ecfc2958483b3b01375c6b54afd443f7a (patch) | |
tree | 8bec7296de055f59aa5ceb634d9bb94c5a568354 /client/mysql_upgrade.c | |
parent | b4573eb4caff7e2a112c79f7923d565fb836e8a0 (diff) | |
download | mariadb-git-4fff310ecfc2958483b3b01375c6b54afd443f7a.tar.gz |
mysql_upgrade win fixes
client/mysql_upgrade.c:
Windows fix
scripts/CMakeLists.txt:
Fix problems with CMakeList causing build to fail
scripts/comp_sql.c:
Improve comp_sql.c to generate output file with shorter strings
Diffstat (limited to 'client/mysql_upgrade.c')
-rw-r--r-- | client/mysql_upgrade.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 92dcb62e8b7..df70ed2c148 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -335,6 +335,10 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) va_end(args); +#ifdef __WIN__ + dynstr_append(&ds_cmdline, "\""); +#endif + DBUG_PRINT("info", ("Running: %s", ds_cmdline.str)); ret= run_command(ds_cmdline.str, ds_res); DBUG_PRINT("exit", ("ret: %d", ret)); @@ -354,11 +358,11 @@ static my_bool get_full_path_to_executable(char* path) { my_bool ret; DBUG_ENTER("get_full_path_to_executable"); -#ifdef WIN - ret= GetModuleFileName(NULL, path, FN_REFLEN) != 0; +#ifdef __WIN__ + ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0); #else /* my_readlink returns 0 if a symlink was read */ - ret= my_readlink(path, "/proc/self/exe", MYF(0)) != 0; + ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0); /* Might also want to try with /proc/$$/exe if the above fails */ #endif DBUG_PRINT("exit", ("path: %s", path)); @@ -416,8 +420,7 @@ static void find_tool(char *tool_path, const char *tool_name) DBUG_PRINT("enter", ("path: %s", path)); /* Chop off last char(since it might be a /) */ - size_t pos= max((strlen(path)-1), 0); - path[pos]= 0; + path[max((strlen(path)-1), 0)]= 0; /* Chop off last dir part */ dirname_part(path, path); |