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
f4680554
Commit
f4680554
authored
Feb 18, 2010
by
Paul Vriens
Committed by
Alexandre Julliard
Feb 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Remove some unneeded extension checking.
parent
cffd28f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
batch.c
programs/cmd/batch.c
+2
-22
No files found.
programs/cmd/batch.c
View file @
f4680554
...
...
@@ -47,35 +47,15 @@ extern DWORD errorlevel;
void
WCMD_batch
(
WCHAR
*
file
,
WCHAR
*
command
,
int
called
,
WCHAR
*
startLabel
,
HANDLE
pgmHandle
)
{
#define WCMD_BATCH_EXT_SIZE 5
HANDLE
h
=
INVALID_HANDLE_VALUE
;
WCHAR
string
[
MAXSTRING
];
static
const
WCHAR
extension_batch
[][
WCMD_BATCH_EXT_SIZE
]
=
{{
'.'
,
'b'
,
'a'
,
't'
,
'\0'
},
{
'.'
,
'c'
,
'm'
,
'd'
,
'\0'
}};
static
const
WCHAR
extension_exe
[
WCMD_BATCH_EXT_SIZE
]
=
{
'.'
,
'e'
,
'x'
,
'e'
,
'\0'
};
unsigned
int
i
;
BATCH_CONTEXT
*
prev_context
;
if
(
startLabel
==
NULL
)
{
for
(
i
=
0
;
(
i
<
sizeof
(
extension_batch
)
/
(
WCMD_BATCH_EXT_SIZE
*
sizeof
(
WCHAR
)))
&&
(
h
==
INVALID_HANDLE_VALUE
);
i
++
)
{
strcpyW
(
string
,
file
);
CharLowerW
(
string
);
if
(
strstrW
(
string
,
extension_batch
[
i
])
==
NULL
)
strcatW
(
string
,
extension_batch
[
i
]);
h
=
CreateFileW
(
string
,
GENERIC_READ
,
FILE_SHARE_READ
,
h
=
CreateFileW
(
file
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
}
if
(
h
==
INVALID_HANDLE_VALUE
)
{
strcpyW
(
string
,
file
);
CharLowerW
(
string
);
if
(
strstrW
(
string
,
extension_exe
)
==
NULL
)
strcatW
(
string
,
extension_exe
);
if
(
GetFileAttributesW
(
string
)
!=
INVALID_FILE_ATTRIBUTES
)
{
WCMD_run_program
(
command
,
0
);
}
else
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
WCMD_print_error
();
}
return
;
}
}
else
{
...
...
@@ -91,7 +71,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
prev_context
=
context
;
context
=
LocalAlloc
(
LMEM_FIXED
,
sizeof
(
BATCH_CONTEXT
));
context
->
h
=
h
;
context
->
batchfileW
=
WCMD_strdupW
(
string
);
context
->
batchfileW
=
WCMD_strdupW
(
file
);
context
->
command
=
command
;
memset
(
context
->
shift_count
,
0x00
,
sizeof
(
context
->
shift_count
));
context
->
prev_context
=
prev_context
;
...
...
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