Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7ade261c
Commit
7ade261c
authored
Jul 29, 2004
by
Troy Rollo
Committed by
Alexandre Julliard
Jul 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix parsing of string literals.
parent
333d2dfe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
12 deletions
+40
-12
cond.y
dlls/msi/cond.y
+40
-12
No files found.
dlls/msi/cond.y
View file @
7ade261c
...
@@ -56,6 +56,7 @@ struct cond_str {
...
@@ -56,6 +56,7 @@ struct cond_str {
};
};
static
LPWSTR
COND_GetString
(
struct
cond_str
*
str
);
static
LPWSTR
COND_GetString
(
struct
cond_str
*
str
);
static
LPWSTR
COND_GetLiteral
(
struct
cond_str
*
str
);
static
int
COND_lex
(
void
*
COND_lval
,
COND_input
*
info
);
static
int
COND_lex
(
void
*
COND_lval
,
COND_input
*
info
);
typedef
INT
(*
comp_int
)(
INT
a
,
INT
b
);
typedef
INT
(*
comp_int
)(
INT
a
,
INT
b
);
...
@@ -115,9 +116,9 @@ static INT comp_ge_m2(INT a, LPWSTR b);
...
@@ -115,9 +116,9 @@ static INT comp_ge_m2(INT a, LPWSTR b);
%
token
COND_SPACE
COND_EOF
COND_SPACE
%
token
COND_SPACE
COND_EOF
COND_SPACE
%
token
COND_OR
COND_AND
COND_NOT
%
token
COND_OR
COND_AND
COND_NOT
%
token
COND_LT
COND_GT
COND_EQ
%
token
COND_LT
COND_GT
COND_EQ
%
token
COND_LPAR
COND_RPAR
COND_
DBLQ
COND_
TILDA
%
token
COND_LPAR
COND_RPAR
COND_TILDA
%
token
COND_PERCENT
COND_DOLLARS
COND_QUESTION
COND_AMPER
COND_EXCLAM
%
token
COND_PERCENT
COND_DOLLARS
COND_QUESTION
COND_AMPER
COND_EXCLAM
%
token
<
str
>
COND_IDENT
<
str
>
COND_NUMBER
%
token
<
str
>
COND_IDENT
<
str
>
COND_NUMBER
<
str
>
COND_LITER
%
nonassoc
COND_EOF
COND_ERROR
%
nonassoc
COND_EOF
COND_ERROR
...
@@ -395,15 +396,12 @@ value_s:
...
@@ -395,15 +396,12 @@ value_s:
;
;
literal
:
literal
:
COND_DBLQ
identifier
COND_DBLQ
COND_LITER
{
{
$$
=
$
2
;
$$
=
COND_GetLiteral
(&$
1
);
}
if
(
!$$ )
|
COND_DBLQ
integer
COND_DBLQ
YYABORT
;
{
}
static
const
WCHAR
pi
[]
=
{
'%'
,
'i'
,
0
};
sprintfW
($$,
pi
,$
2
);
}
;
;
symbol_i
:
symbol_i
:
...
@@ -617,10 +615,26 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond )
...
@@ -617,10 +615,26 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond )
case
'%'
:
rc
=
COND_PERCENT
;
break
;
case
'%'
:
rc
=
COND_PERCENT
;
break
;
case
' '
:
rc
=
COND_SPACE
;
break
;
case
' '
:
rc
=
COND_SPACE
;
break
;
case
'='
:
rc
=
COND_EQ
;
break
;
case
'='
:
rc
=
COND_EQ
;
break
;
case
'"'
:
rc
=
COND_DBLQ
;
break
;
case
'~'
:
rc
=
COND_TILDA
;
break
;
case
'~'
:
rc
=
COND_TILDA
;
break
;
case
'<'
:
rc
=
COND_LT
;
break
;
case
'<'
:
rc
=
COND_LT
;
break
;
case
'>'
:
rc
=
COND_GT
;
break
;
case
'>'
:
rc
=
COND_GT
;
break
;
case
'"'
:
{
const
WCHAR
*
ch2
=
str
->
data
+
1
;
while
(
*
ch2
&&
*
ch2
!= '"' )
++
ch2
;
if
(*
ch2
==
'"'
)
{
len
=
ch2
-
str
->
data
+
1
;
rc
=
COND_LITER
;
break
;
}
}
ERR
(
"Unterminated string
\n
"
);
rc
=
COND_ERROR
;
break
;
default
:
default
:
if
(
COND_IsAlpha
(
ch
)
)
if
(
COND_IsAlpha
(
ch
)
)
{
{
...
@@ -686,6 +700,20 @@ static LPWSTR COND_GetString( struct cond_str *str )
...
@@ -686,6 +700,20 @@ static LPWSTR COND_GetString( struct cond_str *str )
return
ret
;
return
ret
;
}
}
static
LPWSTR
COND_GetLiteral
(
struct
cond_str
*
str
)
{
LPWSTR
ret
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
str
->
len
-
1
)
*
sizeof
(
WCHAR
)
);
if
(
ret
)
{
memcpy
(
ret
,
str
->
data
+
1
,
(
str
->
len
-
2
)
*
sizeof
(
WCHAR
)
);
ret
[
str
->
len
-
2
]=
0
;
}
TRACE
(
"Got literal %s
\n
"
,
debugstr_w
(
ret
));
return
ret
;
}
static
int
COND_error
(
char
*
str
)
static
int
COND_error
(
char
*
str
)
{
{
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment