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
4ef2f8ba
Commit
4ef2f8ba
authored
Mar 13, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Add TYPE multiple file support.
parent
085c0f4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
17 deletions
+38
-17
builtins.c
programs/cmd/builtins.c
+36
-15
wcmd.h
programs/cmd/wcmd.h
+1
-1
wcmdmain.c
programs/cmd/wcmdmain.c
+1
-1
No files found.
programs/cmd/builtins.c
View file @
4ef2f8ba
...
@@ -1432,28 +1432,49 @@ void WCMD_title (char *command) {
...
@@ -1432,28 +1432,49 @@ void WCMD_title (char *command) {
* Copy a file to standard output.
* Copy a file to standard output.
*/
*/
void
WCMD_type
(
voi
d
)
{
void
WCMD_type
(
char
*
comman
d
)
{
HANDLE
h
;
int
argno
=
0
;
char
buffer
[
512
]
;
char
*
argN
=
command
;
DWORD
count
;
BOOL
writeHeaders
=
FALSE
;
if
(
param1
[
0
]
==
0x00
)
{
if
(
param1
[
0
]
==
0x00
)
{
WCMD_output
(
"Argument missing
\n
"
);
WCMD_output
(
"Argument missing
\n
"
);
return
;
return
;
}
}
h
=
CreateFile
(
param1
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
param2
[
0
]
!=
0x00
)
writeHeaders
=
TRUE
;
if
(
h
==
INVALID_HANDLE_VALUE
)
{
WCMD_print_error
();
/* Loop through all args */
return
;
errorlevel
=
0
;
}
while
(
argN
)
{
while
(
ReadFile
(
h
,
buffer
,
sizeof
(
buffer
),
&
count
,
NULL
))
{
char
*
thisArg
=
WCMD_parameter
(
command
,
argno
++
,
&
argN
);
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
buffer
[
count
]
=
0
;
HANDLE
h
;
WCMD_output_asis
(
buffer
);
char
buffer
[
512
];
DWORD
count
;
if
(
!
argN
)
break
;
WINE_TRACE
(
"type: Processing arg '%s'
\n
"
,
thisArg
);
h
=
CreateFile
(
thisArg
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
h
==
INVALID_HANDLE_VALUE
)
{
WCMD_print_error
();
WCMD_output
(
"%s :Failed
\n
"
,
thisArg
);
errorlevel
=
1
;
}
else
{
if
(
writeHeaders
)
{
WCMD_output
(
"
\n
%s
\n\n
"
,
thisArg
);
}
while
(
ReadFile
(
h
,
buffer
,
sizeof
(
buffer
),
&
count
,
NULL
))
{
if
(
count
==
0
)
break
;
/* ReadFile reports success on EOF! */
buffer
[
count
]
=
0
;
WCMD_output_asis
(
buffer
);
}
CloseHandle
(
h
);
}
}
}
CloseHandle
(
h
);
}
}
/****************************************************************************
/****************************************************************************
...
...
programs/cmd/wcmd.h
View file @
4ef2f8ba
...
@@ -71,7 +71,7 @@ void WCMD_setshow_time (void);
...
@@ -71,7 +71,7 @@ void WCMD_setshow_time (void);
void
WCMD_shift
(
char
*
command
);
void
WCMD_shift
(
char
*
command
);
void
WCMD_show_prompt
(
void
);
void
WCMD_show_prompt
(
void
);
void
WCMD_title
(
char
*
);
void
WCMD_title
(
char
*
);
void
WCMD_type
(
void
);
void
WCMD_type
(
char
*
);
void
WCMD_verify
(
char
*
command
);
void
WCMD_verify
(
char
*
command
);
void
WCMD_version
(
void
);
void
WCMD_version
(
void
);
int
WCMD_volume
(
int
mode
,
char
*
command
);
int
WCMD_volume
(
int
mode
,
char
*
command
);
...
...
programs/cmd/wcmdmain.c
View file @
4ef2f8ba
...
@@ -669,7 +669,7 @@ void WCMD_process_command (char *command)
...
@@ -669,7 +669,7 @@ void WCMD_process_command (char *command)
WCMD_title
(
&
whichcmd
[
count
+
1
]);
WCMD_title
(
&
whichcmd
[
count
+
1
]);
break
;
break
;
case
WCMD_TYPE
:
case
WCMD_TYPE
:
WCMD_type
();
WCMD_type
(
p
);
break
;
break
;
case
WCMD_VER
:
case
WCMD_VER
:
WCMD_version
();
WCMD_version
();
...
...
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