mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 00:33:38 +00:00
atl: Support escaped quotes in registrar scripts.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1e52895ef7
commit
6f485a361f
|
@ -118,6 +118,8 @@ static HRESULT get_word(LPCOLESTR *str, strbuf *buf)
|
|||
if(*iter == '}' || *iter == '=') {
|
||||
strbuf_write(iter++, buf, 1);
|
||||
}else if(*iter == '\'') {
|
||||
for (;;)
|
||||
{
|
||||
iter2 = ++iter;
|
||||
iter = wcschr(iter, '\'');
|
||||
if(!iter) {
|
||||
|
@ -125,6 +127,10 @@ static HRESULT get_word(LPCOLESTR *str, strbuf *buf)
|
|||
*str = iter;
|
||||
return DISP_E_EXCEPTION;
|
||||
}
|
||||
if (iter[1] != '\'') break;
|
||||
iter++;
|
||||
strbuf_write(iter2, buf, iter-iter2);
|
||||
}
|
||||
strbuf_write(iter2, buf, iter-iter2);
|
||||
iter++;
|
||||
}else {
|
||||
|
|
|
@ -42,7 +42,9 @@ static const char textA[] =
|
|||
"{ \n"
|
||||
" ForceRemove eebf73c4-50fd-478f-bbcf-db212221227a \n"
|
||||
" { \n"
|
||||
" val 'string' = s 'string' \n"
|
||||
" val 'str1' = s 'string' \n"
|
||||
" val 'str2' = s 'str\\\"ing' \n"
|
||||
" val 'str3' = s 'str''ing' \n"
|
||||
" val 'dword_quoted_dec' = d '1' \n"
|
||||
" val 'dword_unquoted_dec' = d 1 \n"
|
||||
" val 'dword_quoted_hex' = d '0xA' \n"
|
||||
|
@ -81,6 +83,7 @@ static void test_registrar(void)
|
|||
LONG lret;
|
||||
HKEY key;
|
||||
BYTE bytes[4];
|
||||
char buffer[16];
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, count);
|
||||
hr = IRegistrar_StringRegister(registrar, textW);
|
||||
|
@ -94,6 +97,21 @@ static void test_registrar(void)
|
|||
lret = RegOpenKeyA(HKEY_CURRENT_USER, "eebf73c4-50fd-478f-bbcf-db212221227a", &key);
|
||||
ok(lret == ERROR_SUCCESS, "error %ld opening registry key\n", lret);
|
||||
|
||||
size = sizeof(buffer);
|
||||
lret = RegQueryValueExA(key, "str1", NULL, NULL, (BYTE*)buffer, &size);
|
||||
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
|
||||
ok(!strcmp( buffer, "string"), "wrong data %s\n", debugstr_a(buffer));
|
||||
|
||||
size = sizeof(buffer);
|
||||
lret = RegQueryValueExA(key, "str2", NULL, NULL, (BYTE*)buffer, &size);
|
||||
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
|
||||
ok(!strcmp( buffer, "str\\\"ing"), "wrong data %s\n", debugstr_a(buffer));
|
||||
|
||||
size = sizeof(buffer);
|
||||
lret = RegQueryValueExA(key, "str3", NULL, NULL, (BYTE*)buffer, &size);
|
||||
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
|
||||
ok(!strcmp( buffer, "str'ing"), "wrong data %s\n", debugstr_a(buffer));
|
||||
|
||||
size = sizeof(dword);
|
||||
lret = RegQueryValueExA(key, "dword_unquoted_hex", NULL, NULL, (BYTE*)&dword, &size);
|
||||
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
|
||||
|
|
Loading…
Reference in a new issue