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
60fe4dae
Commit
60fe4dae
authored
Feb 02, 2010
by
Dan Kegel
Committed by
Alexandre Julliard
Feb 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: %~dp0 should expand to the directory containing the batch file, not the current directory.
parent
4509d9aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
batch.c
programs/cmd/batch.c
+5
-1
wcmd.h
programs/cmd/wcmd.h
+1
-0
No files found.
programs/cmd/batch.c
View file @
60fe4dae
...
@@ -91,6 +91,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
...
@@ -91,6 +91,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
prev_context
=
context
;
prev_context
=
context
;
context
=
LocalAlloc
(
LMEM_FIXED
,
sizeof
(
BATCH_CONTEXT
));
context
=
LocalAlloc
(
LMEM_FIXED
,
sizeof
(
BATCH_CONTEXT
));
context
->
h
=
h
;
context
->
h
=
h
;
context
->
batchfileW
=
WCMD_strdupW
(
string
);
context
->
command
=
command
;
context
->
command
=
command
;
memset
(
context
->
shift_count
,
0x00
,
sizeof
(
context
->
shift_count
));
memset
(
context
->
shift_count
,
0x00
,
sizeof
(
context
->
shift_count
));
context
->
prev_context
=
prev_context
;
context
->
prev_context
=
prev_context
;
...
@@ -122,6 +123,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
...
@@ -122,6 +123,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
* to the caller's caller.
* to the caller's caller.
*/
*/
HeapFree
(
GetProcessHeap
(),
0
,
context
->
batchfileW
);
LocalFree
(
context
);
LocalFree
(
context
);
if
((
prev_context
!=
NULL
)
&&
(
!
called
))
{
if
((
prev_context
!=
NULL
)
&&
(
!
called
))
{
prev_context
->
skip_rest
=
TRUE
;
prev_context
->
skip_rest
=
TRUE
;
...
@@ -382,7 +384,9 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
...
@@ -382,7 +384,9 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
if
(
lastModifier
==
firstModifier
)
return
;
/* Invalid syntax */
if
(
lastModifier
==
firstModifier
)
return
;
/* Invalid syntax */
/* Extract the parameter to play with */
/* Extract the parameter to play with */
if
((
*
lastModifier
>=
'0'
&&
*
lastModifier
<=
'9'
))
{
if
(
*
lastModifier
==
'0'
)
{
strcpyW
(
outputparam
,
context
->
batchfileW
);
}
else
if
((
*
lastModifier
>=
'1'
&&
*
lastModifier
<=
'9'
))
{
strcpyW
(
outputparam
,
WCMD_parameter
(
context
->
command
,
strcpyW
(
outputparam
,
WCMD_parameter
(
context
->
command
,
*
lastModifier
-
'0'
+
context
->
shift_count
[
*
lastModifier
-
'0'
],
NULL
));
*
lastModifier
-
'0'
+
context
->
shift_count
[
*
lastModifier
-
'0'
],
NULL
));
}
else
{
}
else
{
...
...
programs/cmd/wcmd.h
View file @
60fe4dae
...
@@ -118,6 +118,7 @@ void WCMD_execute (WCHAR *orig_command, WCHAR *redirects, WCHAR *parameter,
...
@@ -118,6 +118,7 @@ void WCMD_execute (WCHAR *orig_command, WCHAR *redirects, WCHAR *parameter,
typedef
struct
{
typedef
struct
{
WCHAR
*
command
;
/* The command which invoked the batch file */
WCHAR
*
command
;
/* The command which invoked the batch file */
HANDLE
h
;
/* Handle to the open batch file */
HANDLE
h
;
/* Handle to the open batch file */
WCHAR
*
batchfileW
;
/* Name of same */
int
shift_count
[
10
];
/* Offset in terms of shifts for %0 - %9 */
int
shift_count
[
10
];
/* Offset in terms of shifts for %0 - %9 */
void
*
prev_context
;
/* Pointer to the previous context block */
void
*
prev_context
;
/* Pointer to the previous context block */
BOOL
skip_rest
;
/* Skip the rest of the batch program and exit */
BOOL
skip_rest
;
/* Skip the rest of the batch program and exit */
...
...
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