setupapi: Remove duplicate backslashes on dirids.
diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c
index ea410f8..d5b7643 100644
--- a/dlls/setupapi/parser.c
+++ b/dlls/setupapi/parser.c
@@ -316,7 +316,8 @@
/* 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 @@
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 @@
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;