From f61555f1288340d1b0457921cc250149c6465d01 Mon Sep 17 00:00:00 2001 From: Changhua Date: Mon, 17 Oct 2022 22:17:03 +0800 Subject: [PATCH] Strip tabs --- spy/exec_sql.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spy/exec_sql.cpp b/spy/exec_sql.cpp index 7d92c46..f89efd4 100644 --- a/spy/exec_sql.cpp +++ b/spy/exec_sql.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include "exec_sql.h" @@ -78,7 +79,9 @@ static int cbGetTables(void *ret, int argc, char **argv, char **azColName) if (strcmp(azColName[i], "name") == 0) { tbl->set_name(argv[i] ? argv[i] : ""); } else if (strcmp(azColName[i], "sql") == 0) { - tbl->set_sql(argv[i] ? argv[i] : ""); + string sql(argv[i]); + sql.erase(std::remove(sql.begin(), sql.end(), '\t'), sql.end()); + tbl->set_sql(sql.c_str()); } } return 0;