diff options
author | monty@mysql.com <> | 2004-03-20 12:48:14 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2004-03-20 12:48:14 +0200 |
commit | b6e5c23c26ca4980489bdb1c895f88761c8687a7 (patch) | |
tree | ba8d7c41c7c8065598199d20dacefe1297cc4f27 /client | |
parent | 82c79134b0da6637d38a0589703a2d8a08596269 (diff) | |
download | mariadb-git-b6e5c23c26ca4980489bdb1c895f88761c8687a7.tar.gz |
Ensure that we use unix file format (no \r\n) for all new files
Portability fixes
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 4bcfe93c278..741da982008 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1662,16 +1662,16 @@ int do_while(struct st_query* q) happen for any tests in the test suite. */ -char my_getc(FILE *file) +int my_getc(FILE *file) { if (line_buffer_pos == line_buffer) return fgetc(file); - return line_buffer[--line_buffer_pos]; + return *--line_buffer_pos; } void my_ungetc(int c) { - line_buffer[line_buffer_pos++]= c; + *line_buffer_pos++= (char) c; } @@ -1692,8 +1692,9 @@ my_bool end_of_query(int c) return 1; /* Found delimiter */ /* didn't find delimiter, push back things that we read */ - for (j = 1 ; j <= i ; j++) - my_ungetc(tmp[j]); + my_ungetc(c); + while (i > 1) + my_ungetc(tmp[--i]); return 0; } @@ -2396,9 +2397,6 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) } } - if (glob_replace) - free_replace(); - if (record) { if (!q->record_file[0] && !result_file) @@ -2419,6 +2417,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) mysql_error(mysql); end: + free_replace(); last_result=0; if (ds == &ds_tmp) dynstr_free(&ds_tmp); |