Commit c60bc0c9 authored by Justin Santa Barbara's avatar Justin Santa Barbara Committed by Alexandre Julliard

Fixed problem with check for special characters.

parent 4014c74e
...@@ -310,16 +310,6 @@ static char *make_string(WCHAR *uc, int len, int codepage) ...@@ -310,16 +310,6 @@ static char *make_string(WCHAR *uc, int len, int codepage)
*cptr++ = '"'; *cptr++ = '"';
for(i = b = 0; i < len; i++, uc++) for(i = b = 0; i < len; i++, uc++)
{ {
int n;
if(*uc < 0x100)
{
if(isprint(*uc))
{
*cptr++ = *uc;
b++;
}
else
{
switch(*uc) switch(*uc)
{ {
case '\a': *cptr++ = '\\'; *cptr++ = 'a'; b += 2; break; case '\a': *cptr++ = '\\'; *cptr++ = 'a'; b += 2; break;
...@@ -332,18 +322,19 @@ static char *make_string(WCHAR *uc, int len, int codepage) ...@@ -332,18 +322,19 @@ static char *make_string(WCHAR *uc, int len, int codepage)
case '\\': *cptr++ = '\\'; *cptr++ = '\\'; b += 2; break; case '\\': *cptr++ = '\\'; *cptr++ = '\\'; b += 2; break;
case '"': *cptr++ = '\\'; *cptr++ = '"'; b += 2; break; case '"': *cptr++ = '\\'; *cptr++ = '"'; b += 2; break;
default: default:
n = sprintf(cptr, "\\x%04x", *uc & 0xffff); if (*uc < 0x100 && isprint(*uc))
cptr += n; {
b += n; *cptr++ = *uc;
} b++;
}
} }
else else
{ {
n = sprintf(cptr, "\\x%04x", *uc & 0xffff); int n = sprintf(cptr, "\\x%04x", *uc & 0xffff);
cptr += n; cptr += n;
b += n; b += n;
} }
break;
}
if(i < len-1 && b >= 72) if(i < len-1 && b >= 72)
{ {
*cptr++ = '"'; *cptr++ = '"';
...@@ -381,14 +372,6 @@ static char *make_string(WCHAR *uc, int len, int codepage) ...@@ -381,14 +372,6 @@ static char *make_string(WCHAR *uc, int len, int codepage)
*cptr++ = '"'; *cptr++ = '"';
for(i = b = 0; i < len; i++, cc++) for(i = b = 0; i < len; i++, cc++)
{ {
int n;
if(isprint(*cc))
{
*cptr++ = *cc;
b++;
}
else
{
switch(*cc) switch(*cc)
{ {
case '\a': *cptr++ = '\\'; *cptr++ = 'a'; b += 2; break; case '\a': *cptr++ = '\\'; *cptr++ = 'a'; b += 2; break;
...@@ -401,10 +384,18 @@ static char *make_string(WCHAR *uc, int len, int codepage) ...@@ -401,10 +384,18 @@ static char *make_string(WCHAR *uc, int len, int codepage)
case '\\': *cptr++ = '\\'; *cptr++ = '\\'; b += 2; break; case '\\': *cptr++ = '\\'; *cptr++ = '\\'; b += 2; break;
case '"': *cptr++ = '\\'; *cptr++ = '"'; b += 2; break; case '"': *cptr++ = '\\'; *cptr++ = '"'; b += 2; break;
default: default:
n = sprintf(cptr, "\\x%02x", *cc & 0xff); if(isprint(*cc))
{
*cptr++ = *cc;
b++;
}
else
{
int n = sprintf(cptr, "\\x%02x", *cc & 0xff);
cptr += n; cptr += n;
b += n; b += n;
} }
break;
} }
if(i < len-1 && b >= 72) if(i < len-1 && b >= 72)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment