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
cc4b01a0
Commit
cc4b01a0
authored
Apr 07, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Apr 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Rewrite get_parameter to be able to handle an empty parameter.
parent
e0898f5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
files.c
dlls/advpack/files.c
+23
-24
No files found.
dlls/advpack/files.c
View file @
cc4b01a0
...
...
@@ -452,29 +452,23 @@ HRESULT WINAPI DelNodeW( LPCWSTR pszFileOrDirName, DWORD dwFlags )
return
ret
;
}
/* returns the parameter at dwIndex in a list of parameters
* separated by the cSeparator character
*/
static
LPSTR
get_parameter
(
LPSTR
szParameters
,
CHAR
cSeparator
,
DWORD
dwIndex
)
/* sequentially returns pointers to parameters in a parameter list
* returns NULL if the parameter is empty, e.g. one,,three */
static
LPSTR
get_parameter
(
LPSTR
*
params
,
char
separator
)
{
LPSTR
szParam
=
NULL
;
DWORD
i
=
0
;
LPSTR
token
=
*
params
;
while
(
*
szParameters
&&
i
<
dwIndex
)
{
if
(
*
szParameters
==
cSeparator
)
i
++
;
if
(
!*
params
)
return
NULL
;
szParameters
++
;
}
*
params
=
strchr
(
*
params
,
separator
);
if
(
*
params
)
*
(
*
params
)
++
=
'\0'
;
if
(
!*
szParameters
)
if
(
!*
token
)
return
NULL
;
szParam
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lstrlenA
(
szParameters
));
lstrcpyA
(
szParam
,
szParameters
);
return
szParam
;
return
token
;
}
/***********************************************************************
...
...
@@ -495,21 +489,26 @@ static LPSTR get_parameter(LPSTR szParameters, CHAR cSeparator, DWORD dwIndex)
HRESULT
WINAPI
DelNodeRunDLL32A
(
HWND
hWnd
,
HINSTANCE
hInst
,
LPSTR
cmdline
,
INT
show
)
{
LPSTR
szFilename
,
szFlags
;
DWORD
dwFlags
;
LPSTR
cmdline_copy
,
cmdline_ptr
;
DWORD
dwFlags
=
0
;
HRESULT
res
;
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
cmdline
));
TRACE
(
"(%p, %p, %s, %i)
\n
"
,
hWnd
,
hInst
,
debugstr_a
(
cmdline
),
show
);
cmdline_copy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lstrlenA
(
cmdline
)
+
1
);
cmdline_ptr
=
cmdline_copy
;
lstrcpyA
(
cmdline_copy
,
cmdline
);
/* get the parameters at indexes 0 and 1 respectively */
szFilename
=
get_parameter
(
cmdline
,
','
,
0
);
szFlags
=
get_parameter
(
cmdline
,
','
,
1
);
szFilename
=
get_parameter
(
&
cmdline_ptr
,
','
);
szFlags
=
get_parameter
(
&
cmdline_ptr
,
','
);
dwFlags
=
atol
(
szFlags
);
if
(
szFlags
)
dwFlags
=
atol
(
szFlags
);
res
=
DelNodeA
(
szFilename
,
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
szFilename
);
HeapFree
(
GetProcessHeap
(),
0
,
szFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
cmdline_copy
);
return
res
;
}
...
...
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