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
4e10456b
Commit
4e10456b
authored
Oct 01, 2012
by
Jason Edmeades
Committed by
Alexandre Julliard
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Ensure current directory saved during cmd /c.
parent
c55cd876
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
wcmdmain.c
programs/cmd/wcmdmain.c
+9
-9
No files found.
programs/cmd/wcmdmain.c
View file @
4e10456b
...
...
@@ -2509,6 +2509,15 @@ int wmain (int argc, WCHAR *argvW[])
WCMD_strip_quotes
(
cmd
);
}
/* Save cwd into appropriate env var (Must be before the /c processing */
GetCurrentDirectoryW
(
sizeof
(
string
)
/
sizeof
(
WCHAR
),
string
);
if
(
IsCharAlphaW
(
string
[
0
])
&&
string
[
1
]
==
':'
)
{
static
const
WCHAR
fmt
[]
=
{
'='
,
'%'
,
'c'
,
':'
,
'\0'
};
wsprintfW
(
envvar
,
fmt
,
string
[
0
]);
SetEnvironmentVariableW
(
envvar
,
string
);
WINE_TRACE
(
"Set %s to %s
\n
"
,
wine_dbgstr_w
(
envvar
),
wine_dbgstr_w
(
string
));
}
if
(
opt_c
)
{
/* If we do a "cmd /c command", we don't want to allocate a new
* console since the command returns immediately. Rather, we use
...
...
@@ -2602,15 +2611,6 @@ int wmain (int argc, WCHAR *argvW[])
}
/* Save cwd into appropriate env var */
GetCurrentDirectoryW
(
1024
,
string
);
if
(
IsCharAlphaW
(
string
[
0
])
&&
string
[
1
]
==
':'
)
{
static
const
WCHAR
fmt
[]
=
{
'='
,
'%'
,
'c'
,
':'
,
'\0'
};
wsprintfW
(
envvar
,
fmt
,
string
[
0
]);
SetEnvironmentVariableW
(
envvar
,
string
);
WINE_TRACE
(
"Set %s to %s
\n
"
,
wine_dbgstr_w
(
envvar
),
wine_dbgstr_w
(
string
));
}
if
(
opt_k
)
{
/* Parse the command string, without reading any more input */
WCMD_ReadAndParseLine
(
cmd
,
&
toExecute
,
INVALID_HANDLE_VALUE
);
...
...
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