summaryrefslogtreecommitdiff
path: root/client/mysqltest.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2011-05-18 15:15:36 +0200
committerunknown <knielsen@knielsen-hq.org>2011-05-18 15:15:36 +0200
commite55fb3bbe844dcc5f53ea7bdb6f13b5b79ff56ec (patch)
tree832a8da572f9829670dc74c5d5dc8ec7e959a262 /client/mysqltest.cc
parent984fa23b457fe0956fd118ea543467b2d2c7475e (diff)
downloadmariadb-git-e55fb3bbe844dcc5f53ea7bdb6f13b5b79ff56ec.tar.gz
Fix mysqltest printing of include stack.
The printing of include stack in the error case in mysqltest omitted the bottom of the stack (the line number in original test case file), and instead printed the top of the stack twice. Fix to print each element on the stack once and only once.
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r--client/mysqltest.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 16ab64fb424..0b08564b07a 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1270,12 +1270,17 @@ static void cleanup_and_exit(int exit_code)
void print_file_stack()
{
- for (struct st_test_file* err_file= cur_file;
- err_file != file_stack;
- err_file--)
+ struct st_test_file* err_file= cur_file;
+ if (err_file == file_stack)
+ return;
+
+ for (;;)
{
+ err_file--;
fprintf(stderr, "included from %s at line %d:\n",
err_file->file_name, err_file->lineno);
+ if (err_file == file_stack)
+ break;
}
}