Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7f901f41
Commit
7f901f41
authored
Aug 10, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Aug 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Remove duplicate backslashes on dirids.
parent
d391c11d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
advpack.c
dlls/advpack/tests/advpack.c
+4
-6
parser.c
dlls/setupapi/parser.c
+4
-2
parser.c
dlls/setupapi/tests/parser.c
+12
-0
No files found.
dlls/advpack/tests/advpack.c
View file @
7f901f41
...
...
@@ -419,12 +419,10 @@ static void translateinfstringex_test(void)
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"Result1"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
todo_wine
{
/* Wine returns C:\\Program Files, not C:\Program Files */
ok
(
!
lstrcmpi
(
buffer
,
PROG_FILES_ROOT
),
"Expected %s, got %s
\n
"
,
PROG_FILES_ROOT
,
buffer
);
ok
(
size
==
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %d
\n
"
,
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
size
);
}
ok
(
!
lstrcmpi
(
buffer
,
PROG_FILES_ROOT
),
"Expected %s, got %s
\n
"
,
PROG_FILES_ROOT
,
buffer
);
ok
(
size
==
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %d
\n
"
,
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
size
);
memset
(
buffer
,
'a'
,
PROG_FILES_LEN
);
buffer
[
PROG_FILES_LEN
-
1
]
=
'\0'
;
...
...
dlls/setupapi/parser.c
View file @
7f901f41
...
...
@@ -316,7 +316,8 @@ static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned
/* retrieve the string substitution for a given string, or NULL if not found */
/* if found, len is set to the substitution length */
static
const
WCHAR
*
get_string_subst
(
struct
inf_file
*
file
,
const
WCHAR
*
str
,
unsigned
int
*
len
)
static
const
WCHAR
*
get_string_subst
(
struct
inf_file
*
file
,
const
WCHAR
*
str
,
unsigned
int
*
len
,
BOOL
no_trailing_slash
)
{
static
const
WCHAR
percent
=
'%'
;
...
...
@@ -353,6 +354,7 @@ static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, u
dirid_str
[
*
len
]
=
0
;
dirid
=
strtolW
(
dirid_str
,
&
end
,
10
);
if
(
!*
end
)
ret
=
get_dirid_subst
(
file
,
dirid
,
len
);
if
(
no_trailing_slash
&&
ret
&&
*
len
&&
ret
[
*
len
-
1
]
==
'\\'
)
*
len
-=
1
;
HeapFree
(
GetProcessHeap
(),
0
,
dirid_str
);
return
ret
;
}
...
...
@@ -387,7 +389,7 @@ unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCH
else
/* end of the %xx% string, find substitution */
{
len
=
p
-
start
-
1
;
subst
=
get_string_subst
(
file
,
start
+
1
,
&
len
);
subst
=
get_string_subst
(
file
,
start
+
1
,
&
len
,
p
[
1
]
==
'\\'
);
if
(
!
subst
)
{
subst
=
start
;
...
...
dlls/setupapi/tests/parser.c
View file @
7f901f41
...
...
@@ -60,6 +60,7 @@ static const char tmpfilename[] = ".\\tmp.inf";
#define STR_SECTION "[Strings]\nfoo=aaa\nbar=bbb\nloop=%loop2%\nloop2=%loop%\n" \
"per%%cent=abcd\nper=1\ncent=2\n22=foo\n" \
"big=" A400 "\n" \
"mydrive=\"C:\\\"\n" \
"verybig=" A400 A400 A400 "\n"
/* create a new file with specified contents and open it */
...
...
@@ -284,6 +285,7 @@ static const struct
{
"ab=cd
\"
,
\"
ef"
,
"ab"
,
{
"cd,ef"
}
},
{
"ab=cd
\"
,ef"
,
"ab"
,
{
"cd,ef"
}
},
{
"ab=cd
\"
,ef
\\\n
ab"
,
"ab"
,
{
"cd,ef
\\
"
}
},
/* single quotes (unhandled)*/
{
"HKLM,A,B,'C',D"
,
NULL
,
{
"HKLM"
,
"A"
,
"B"
,
"'C'"
,
"D"
}
},
/* spaces */
...
...
@@ -317,6 +319,16 @@ static const struct
{
"a=%big%%big%%big%%big%
\n
"
STR_SECTION
,
"a"
,
{
A400
A400
A400
A400
}
},
{
"a=%big%%big%%big%%big%%big%%big%%big%%big%%big%
\n
"
STR_SECTION
,
"a"
,
{
A400
A400
A400
A400
A400
A400
A400
A400
A400
}
},
{
"a=%big%%big%%big%%big%%big%%big%%big%%big%%big%%big%%big%
\n
"
STR_SECTION
,
"a"
,
{
A4097
/*MAX_INF_STRING_LENGTH+1*/
}
},
/* Prove expansion of system entries removes extra \'s and string
replacements doesnt */
{
"ab=
\"
%24%
\"\n
"
STR_SECTION
,
"ab"
,
{
"C:
\\
"
}
},
{
"ab=
\"
%mydrive%
\"\n
"
STR_SECTION
,
"ab"
,
{
"C:
\\
"
}
},
{
"ab=
\"
%24%
\\
fred
\"\n
"
STR_SECTION
,
"ab"
,
{
"C:
\\
fred"
}
},
{
"ab=
\"
%mydrive%
\\
fred
\"\n
"
STR_SECTION
,
"ab"
,
{
"C:
\\\\
fred"
}
},
/* Confirm duplicate \'s kept */
{
"ab=
\"
%24%
\\\\
fred
\"
"
,
"ab"
,
{
"C:
\\\\
fred"
}
},
{
"ab=C:
\\\\
FRED"
,
"ab"
,
{
"C:
\\\\
FRED"
}
},
};
/* check the key of a certain line */
...
...
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