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:
@ -227,9 +227,11 @@ int sqlite3Dequote(char *z){
|
|||||||
// TODO: removed.
|
// TODO: removed.
|
||||||
break;
|
break;
|
||||||
}else if ( z[i]=='\\' ){
|
}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]=='\\' ){
|
if ( z[i+1]==quote || z[i+1]=='\\' ){
|
||||||
z[j++] = quote;
|
z[j++] = z[i+1];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
Reference in New Issue
Block a user