mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
SqliteTableModel: Fix bug in last commit to support multiline strings
Fix a bug in the last commit to correctly remove comments on multi-line queries.
This commit is contained in:
@@ -736,7 +736,7 @@ void DBBrowserDB::logSQL(QString statement, int msgtype)
|
||||
// Replace binary log messages by a placeholder text instead of printing gibberish
|
||||
for(int i=0;i<statement.size();i++)
|
||||
{
|
||||
if(statement.at(i) < 32)
|
||||
if(statement.at(i) < 32 && statement.at(i) != '\n')
|
||||
{
|
||||
statement.truncate(32);
|
||||
statement.append(QObject::tr("... <string can not be logged, contains binary data> ..."));
|
||||
|
||||
@@ -62,7 +62,7 @@ QString removeComments(QString s)
|
||||
stringChars.push_back(s.at(i));
|
||||
} else if(stringChars.empty() && s.at(i) == '-' && lastChar == '-') {
|
||||
if(s.contains('\n'))
|
||||
return removeComments(s.remove(i-1, s.indexOf('\n', i)-i));
|
||||
return removeComments(s.remove(i-1, s.indexOf('\n', i)-i+2));
|
||||
else
|
||||
return s.left(i-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user