Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8c540ba6
Commit
8c540ba6
authored
Feb 06, 2006
by
Rein Klazes
Committed by
Alexandre Julliard
Feb 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wcmd: CALL should search the current PATH.
parent
e66e227d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
batch.c
programs/wcmd/batch.c
+1
-1
wcmd.h
programs/wcmd/wcmd.h
+1
-1
wcmdmain.c
programs/wcmd/wcmdmain.c
+10
-7
No files found.
programs/wcmd/batch.c
View file @
8c540ba6
...
...
@@ -69,7 +69,7 @@ BATCH_CONTEXT *prev_context;
h
=
CreateFile
(
string
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
WCMD_run_program
(
command
);
WCMD_run_program
(
command
,
0
);
}
else
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
WCMD_print_error
();
...
...
programs/wcmd/wcmd.h
View file @
8c540ba6
...
...
@@ -53,7 +53,7 @@ void WCMD_process_command (char *command);
int
WCMD_read_console
(
char
*
string
,
int
str_len
);
void
WCMD_remove_dir
(
void
);
void
WCMD_rename
(
void
);
void
WCMD_run_program
(
char
*
command
);
void
WCMD_run_program
(
char
*
command
,
int
called
);
void
WCMD_setlocal
(
const
char
*
command
);
void
WCMD_setshow_attrib
(
void
);
void
WCMD_setshow_date
(
void
);
...
...
programs/wcmd/wcmdmain.c
View file @
8c540ba6
...
...
@@ -359,7 +359,7 @@ void WCMD_process_command (char *command)
WCMD_setshow_attrib
();
break
;
case
WCMD_CALL
:
WCMD_
batch
(
param1
,
p
,
1
);
WCMD_
run_program
(
p
,
1
);
break
;
case
WCMD_CD
:
case
WCMD_CHDIR
:
...
...
@@ -462,7 +462,7 @@ void WCMD_process_command (char *command)
case
WCMD_EXIT
:
ExitProcess
(
0
);
default:
WCMD_run_program
(
whichcmd
);
WCMD_run_program
(
whichcmd
,
0
);
}
HeapFree
(
GetProcessHeap
(),
0
,
cmd
);
if
(
old_stdin
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -532,11 +532,14 @@ static void init_msvcrt_io_block(STARTUPINFO* st)
*
* Execute a command line as an external program. If no extension given then
* precedence is given to .BAT files. Must allow recursion.
*
* called is 1 if the program was invoked with a CALL command - removed
* from command -. It is only used for batch programs.
*
* FIXME: Case sensitivity in suffixes!
*/
void
WCMD_run_program
(
char
*
command
)
{
void
WCMD_run_program
(
char
*
command
,
int
called
)
{
STARTUPINFO
st
;
PROCESS_INFORMATION
pe
;
...
...
@@ -555,14 +558,14 @@ char filetorun[MAX_PATH];
if
(
!
ext
||
!
strcasecmp
(
ext
,
".bat"
))
{
if
(
SearchPath
(
NULL
,
param1
,
".bat"
,
sizeof
(
filetorun
),
filetorun
,
NULL
))
{
WCMD_batch
(
filetorun
,
command
,
0
);
WCMD_batch
(
filetorun
,
command
,
called
);
return
;
}
}
if
(
!
ext
||
!
strcasecmp
(
ext
,
".cmd"
))
{
if
(
SearchPath
(
NULL
,
param1
,
".cmd"
,
sizeof
(
filetorun
),
filetorun
,
NULL
))
{
WCMD_batch
(
filetorun
,
command
,
0
);
WCMD_batch
(
filetorun
,
command
,
called
);
return
;
}
}
...
...
@@ -571,7 +574,7 @@ char filetorun[MAX_PATH];
char
*
ext
=
strrchr
(
param1
,
'.'
);
if
(
ext
&&
(
!
strcasecmp
(
ext
,
".bat"
)
||
!
strcasecmp
(
ext
,
".cmd"
)))
{
WCMD_batch
(
param1
,
command
,
0
);
WCMD_batch
(
param1
,
command
,
called
);
return
;
}
...
...
@@ -584,7 +587,7 @@ char filetorun[MAX_PATH];
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
h
);
WCMD_batch
(
param1
,
command
,
0
);
WCMD_batch
(
param1
,
command
,
called
);
return
;
}
}
...
...
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