wrc: Allow quotes in resource nameID.

Artur Świgoń aswigon at aswigon.pl
Fri May 12 14:25:00 CDT 2017


I am terribly sorry for my late reply. Please see my comments below.
A draft version of another patch is in the attachment.

> Alexandre Julliard <julliard at winehq.org> writes:
> 
> Artur Świgoń <artur.swigon at gmail.com> writes:
> 
>> @@ -138,6 +142,14 @@ static int wbufalloc = 0;
>> 
>> static int current_codepage = -1;  /* use language default */
>> 
>> +/* Used for differentiating between single- and double-quoted nameID's */
>> +static int id_dblquote = 0;
>> +
>> +/* Used for catching first (quoted) nameID before wanted_id is set.
>> + * This variable is reset to 0 once the first ID (quoted or not), string or
>> + * data has been encountered */
>> +static int id_initial = 1;
> 
> That's a bit hackish. Couldn't you simply set the initial state
> appropriately instead of introducing a separate variable?

I could not make wanted_id have the right value before the first ID.
Neither changing its value at file scope nor in YY_USER_INIT works.
The new proposed solution sets id_dblquote initially to -1 to get rid of
a redundant variable.

>> @@ -402,8 +414,30 @@ static unsigned long xstrtoul(const char *nptr, char **endptr, int base)
>> 0[oO][0-7]+[lL]?	{ parser_lval.num = xstrtoul(yytext+2, 0, 8);
>>                           return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
>> 
>> +<tkid_dbl>[A-Za-z_0-9./\\\']+\" |
>> +<tkid_sgl>[A-Za-z_0-9./\\\"]+\'	{
> 
> There are more characters that should be allowed. Nested quotes are also
> supposed to work.

Nested quotes now work (excluding some exotic combinations that VS2017
rc.exe accepts, allowing which, as it seems to me, would require a major rewrite
instead of a patch). What characters besides both types of quotes should be
additionally allowed?

Artur Świgoń
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wrc-Allow-quotes-in-resource-nameID.patch
Type: application/octet-stream
Size: 3816 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170512/ae992688/attachment.obj>


More information about the wine-devel mailing list