8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 00:03:02 +01:00

On behalf of alexpeshkoff after sourceforge crash - Postfix for CORE-4811: strip single quotes, not making them keep case of ascii string, when used in DPB (connect/create database)

This commit is contained in:
asfernandes 2015-07-26 15:38:06 +00:00
parent 01de4144c4
commit 3fc04a9dd5

View File

@ -1610,6 +1610,7 @@ const char* dpbItemUpper(const char* s, FB_SIZE_T l, Firebird::string& buf)
if (l && (s[0] == '"' || s[0] == '\''))
{
const char end_quote = s[0];
bool ascii = true;
// quoted string - strip quotes
for (FB_SIZE_T i = 1; i < l; ++i)
@ -1622,9 +1623,14 @@ const char* dpbItemUpper(const char* s, FB_SIZE_T l, Firebird::string& buf)
// skipped the escape quote, continue processing
}
if (s[i] & 0x80)
ascii = false;
buf += s[i];
}
if (ascii && s[0] == '\'')
buf.upper();
return buf.c_str();
}