qc_sqlite: Dequote more properly

When a backslash is encountered, the backslash should not be
copied but only the character after that.

For the sake of completeness, a few more characters would have
to be handled explicitly, but as the content of a string will not
affect the statement's classification there is not much point in
doing that.
This commit is contained in:
Johan Wikman 2016-10-05 09:13:56 +03:00
parent 53637af98f
commit 8572eb34a0

View File

@ -227,9 +227,11 @@ int sqlite3Dequote(char *z){
// TODO: removed.
break;
}else if ( z[i]=='\\' ){
z[j++] = '\\';
// If we want to dequote properly, a few more characters would have to be
// handled explicitly. That would not affect the classification, however,
// so we won't do that.
if ( z[i+1]==quote || z[i+1]=='\\' ){
z[j++] = quote;
z[j++] = z[i+1];
i++;
}
} else