Commit 51f96e43 authored by msvensson@pilot.blaudden's avatar msvensson@pilot.blaudden

Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint

into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
parents 478bb9e2 c2c46045
...@@ -103,7 +103,7 @@ static my_bool disable_warnings= 0, disable_ps_warnings= 0; ...@@ -103,7 +103,7 @@ static my_bool disable_warnings= 0, disable_ps_warnings= 0;
static my_bool disable_info= 1; static my_bool disable_info= 1;
static my_bool abort_on_error= 1; static my_bool abort_on_error= 1;
static my_bool server_initialized= 0; static my_bool server_initialized= 0;
static my_bool is_windows= 0;
static char **default_argv; static char **default_argv;
static const char *load_default_groups[]= { "mysqltest", "client", 0 }; static const char *load_default_groups[]= { "mysqltest", "client", 0 };
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer; static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
...@@ -1677,7 +1677,7 @@ void do_exec(struct st_command *command) ...@@ -1677,7 +1677,7 @@ void do_exec(struct st_command *command)
init_dynamic_string(&ds_cmd, 0, command->query_len+256, 256); init_dynamic_string(&ds_cmd, 0, command->query_len+256, 256);
/* Eval the command, thus replacing all environment variables */ /* Eval the command, thus replacing all environment variables */
do_eval(&ds_cmd, cmd, command->end, TRUE); do_eval(&ds_cmd, cmd, command->end, !is_windows);
/* Check if echo should be replaced with "builtin" echo */ /* Check if echo should be replaced with "builtin" echo */
if (builtin_echo[0] && strncmp(cmd, "echo", 4) == 0) if (builtin_echo[0] && strncmp(cmd, "echo", 4) == 0)
...@@ -1686,6 +1686,15 @@ void do_exec(struct st_command *command) ...@@ -1686,6 +1686,15 @@ void do_exec(struct st_command *command)
replace(&ds_cmd, "echo", 4, builtin_echo, strlen(builtin_echo)); replace(&ds_cmd, "echo", 4, builtin_echo, strlen(builtin_echo));
} }
#ifdef __WIN__
/* Replace /dev/null with NUL */
while(replace(&ds_cmd, "/dev/null", 9, "NUL", 3) == 0)
;
/* Replace "closed stdout" with non existing output fd */
while(replace(&ds_cmd, ">&-", 3, ">&4", 3) == 0)
;
#endif
DBUG_PRINT("info", ("Executing '%s' as '%s'", DBUG_PRINT("info", ("Executing '%s' as '%s'",
command->first_argument, ds_cmd.str)); command->first_argument, ds_cmd.str));
...@@ -1845,7 +1854,14 @@ void do_system(struct st_command *command) ...@@ -1845,7 +1854,14 @@ void do_system(struct st_command *command)
init_dynamic_string(&ds_cmd, 0, command->query_len + 64, 256); init_dynamic_string(&ds_cmd, 0, command->query_len + 64, 256);
/* Eval the system command, thus replacing all environment variables */ /* Eval the system command, thus replacing all environment variables */
do_eval(&ds_cmd, command->first_argument, command->end, TRUE); do_eval(&ds_cmd, command->first_argument, command->end, !is_windows);
#ifdef __WIN__
/* Replace /dev/null with NUL */
while(replace(&ds_cmd, "/dev/null", 9, "NUL", 3) == 0)
;
#endif
DBUG_PRINT("info", ("running system command '%s' as '%s'", DBUG_PRINT("info", ("running system command '%s' as '%s'",
command->first_argument, ds_cmd.str)); command->first_argument, ds_cmd.str));
...@@ -5746,6 +5762,7 @@ int main(int argc, char **argv) ...@@ -5746,6 +5762,7 @@ int main(int argc, char **argv)
init_builtin_echo(); init_builtin_echo();
#ifdef __WIN__ #ifdef __WIN__
is_windows= 0;
init_tmp_sh_file(); init_tmp_sh_file();
init_win_path_patterns(); init_win_path_patterns();
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment