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
2b03d7d7
Commit
2b03d7d7
authored
Mar 08, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Add support for working directories per drive.
parent
b6ed73b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
builtins.c
programs/cmd/builtins.c
+11
-0
wcmdmain.c
programs/cmd/wcmdmain.c
+11
-0
No files found.
programs/cmd/builtins.c
View file @
2b03d7d7
...
...
@@ -1108,12 +1108,23 @@ void WCMD_setshow_default (char *command) {
/* Change to that directory */
WINE_TRACE
(
"Really changing to directory '%s'
\n
"
,
string
);
status
=
SetCurrentDirectory
(
string
);
if
(
!
status
)
{
errorlevel
=
1
;
WCMD_print_error
();
return
;
}
/* Set special =C: type environment variable */
if
((
string
[
1
]
==
':'
)
&&
IsCharAlpha
(
string
[
0
]))
{
char
env
[
4
];
strcpy
(
env
,
"="
);
strncpy
(
env
+
1
,
string
,
2
);
env
[
3
]
=
0x00
;
SetEnvironmentVariable
(
env
,
string
);
}
}
return
;
}
...
...
programs/cmd/wcmdmain.c
View file @
2b03d7d7
...
...
@@ -460,6 +460,17 @@ void WCMD_process_command (char *command)
*/
if
((
cmd
[
1
]
==
':'
)
&&
IsCharAlpha
(
cmd
[
0
])
&&
(
strlen
(
cmd
)
==
2
))
{
char
envvar
[
5
];
char
dir
[
MAX_PATH
];
/* According to MSDN CreateProcess docs, special env vars record
the current directory on each drive, in the form =C:
so see if one specified, and if so go back to it */
strcpy
(
envvar
,
"="
);
strcat
(
envvar
,
cmd
);
if
(
GetEnvironmentVariable
(
envvar
,
dir
,
MAX_PATH
)
==
0
)
{
sprintf
(
cmd
,
"%s
\\
"
,
cmd
);
}
status
=
SetCurrentDirectory
(
cmd
);
if
(
!
status
)
WCMD_print_error
();
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
...
...
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