mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Sql: Fixed string escapment of PGSQL strings
git-svn-id: svn://ultimatepp.org/upp/trunk@3828 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d5727dfa95
commit
92c26d3f9e
3 changed files with 16 additions and 5 deletions
|
|
@ -552,6 +552,9 @@ String DeQtfLf(const char *s) {
|
|||
else
|
||||
if(*s == '\n')
|
||||
r.Cat('&');
|
||||
else
|
||||
if(*s == '\t')
|
||||
r.Cat("-|");
|
||||
s++;
|
||||
}
|
||||
return r;
|
||||
|
|
|
|||
|
|
@ -896,12 +896,18 @@ void RichQtfParser::Parse(const char *qtf, int _accesskey)
|
|||
EndPart();
|
||||
SetFormat();
|
||||
const char *b = ++term;
|
||||
for(; *term && *term != '\1'; term++)
|
||||
for(; *term && *term != '\1'; term++) {
|
||||
if((byte)*term == '\n') {
|
||||
text.Cat(ToUnicode(b, (int)(term - b), format.charset));
|
||||
EndPart();
|
||||
b = term + 1;
|
||||
}
|
||||
if((byte)*term == '\t') {
|
||||
text.Cat(ToUnicode(b, (int)(term - b), format.charset));
|
||||
text.Cat(9);
|
||||
b = term + 1;
|
||||
}
|
||||
}
|
||||
text.Cat(ToUnicode(b, (int)(term - b), format.charset));
|
||||
if(*term == '\1')
|
||||
term++;
|
||||
|
|
|
|||
|
|
@ -201,13 +201,15 @@ void SqlCompile(const char *&s, StringBuffer *r, byte dialect)
|
|||
else
|
||||
if(c == '\r')
|
||||
r->Cat("\\r");
|
||||
else
|
||||
if(c == '\t')
|
||||
r->Cat("\\t");
|
||||
else {
|
||||
char h[4];
|
||||
int q = (byte)*s;
|
||||
h[0] = '\\';
|
||||
h[1] = (3 & (q >> 6)) + '0';
|
||||
h[2] = (7 & (q >> 3)) + '0';
|
||||
h[3] = (7 & q) + '0';
|
||||
h[1] = (3 & (c >> 6)) + '0';
|
||||
h[2] = (7 & (c >> 3)) + '0';
|
||||
h[3] = (7 & c) + '0';
|
||||
r->Cat(h, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue