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
1d09a358
Commit
1d09a358
authored
Aug 18, 2015
by
Thomas Faller
Committed by
Alexandre Julliard
Aug 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Implement 'echo/'.
parent
21a14e96
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
builtins.c
programs/cmd/builtins.c
+2
-2
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+8
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+16
-0
wcmdmain.c
programs/cmd/wcmdmain.c
+5
-2
No files found.
programs/cmd/builtins.c
View file @
1d09a358
...
...
@@ -1465,7 +1465,7 @@ void WCMD_echo (const WCHAR *args)
WCHAR
*
trimmed
;
if
(
args
[
0
]
==
' '
||
args
[
0
]
==
'\t'
||
args
[
0
]
==
'.'
||
args
[
0
]
==
':'
||
args
[
0
]
==
';'
)
||
args
[
0
]
==
':'
||
args
[
0
]
==
';'
||
args
[
0
]
==
'/'
)
args
++
;
trimmed
=
WCMD_strtrim
(
args
);
...
...
@@ -1473,7 +1473,7 @@ void WCMD_echo (const WCHAR *args)
count
=
strlenW
(
trimmed
);
if
(
count
==
0
&&
origcommand
[
0
]
!=
'.'
&&
origcommand
[
0
]
!=
':'
&&
origcommand
[
0
]
!=
';'
)
{
&&
origcommand
[
0
]
!=
';'
&&
origcommand
[
0
]
!=
'/'
)
{
if
(
echo_mode
)
WCMD_output
(
WCMD_LoadMessage
(
WCMD_ECHOPROMPT
),
onW
);
else
WCMD_output
(
WCMD_LoadMessage
(
WCMD_ECHOPROMPT
),
offW
);
heap_free
(
trimmed
);
...
...
programs/cmd/tests/test_builtins.cmd
View file @
1d09a358
...
...
@@ -15,6 +15,10 @@ echo:
echo :
echo:word
echo :word
echo/
echo /
echo/word
echo /word
echo off now
echo word@space@
echo word@space@@space@
...
...
@@ -47,6 +51,10 @@ echo:
echo :
echo:word
echo :word
echo/
echo /
echo/word
echo /word
echo on again
echo word@space@
echo word@space@@space@
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
1d09a358
...
...
@@ -42,6 +42,18 @@ word
@pwd@>echo :word@space@
:word
@pwd@>echo/
@pwd@>echo /@space@
/
@pwd@>echo/word
word
@pwd@>echo /word@space@
/word
@pwd@>echo off now@space@
off now
...
...
@@ -93,6 +105,10 @@ word
:
word
:word
/
word
/word
on again
word@space@
word@space@@space@
...
...
programs/cmd/wcmdmain.c
View file @
1d09a358
...
...
@@ -1853,17 +1853,20 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
if
(
context
&&
echo_mode
&&
*
curPos
&&
(
*
curPos
!=
'@'
))
{
static
const
WCHAR
echoDot
[]
=
{
'e'
,
'c'
,
'h'
,
'o'
,
'.'
};
static
const
WCHAR
echoCol
[]
=
{
'e'
,
'c'
,
'h'
,
'o'
,
':'
};
static
const
WCHAR
echoSlash
[]
=
{
'e'
,
'c'
,
'h'
,
'o'
,
'/'
};
const
DWORD
len
=
sizeof
(
echoDot
)
/
sizeof
(
echoDot
[
0
]);
DWORD
curr_size
=
strlenW
(
curPos
);
DWORD
min_len
=
(
curr_size
<
len
?
curr_size
:
len
);
WCMD_show_prompt
();
WCMD_output_asis
(
curPos
);
/* I don't know why Windows puts a space here but it does */
/* Except for lines starting with 'echo.'
or 'echo:
'. Ask MS why */
/* Except for lines starting with 'echo.'
, 'echo:' or 'echo/
'. Ask MS why */
if
(
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
curPos
,
min_len
,
echoDot
,
len
)
!=
CSTR_EQUAL
&&
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
curPos
,
min_len
,
echoCol
,
len
)
!=
CSTR_EQUAL
)
curPos
,
min_len
,
echoCol
,
len
)
!=
CSTR_EQUAL
&&
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
curPos
,
min_len
,
echoSlash
,
len
)
!=
CSTR_EQUAL
)
{
WCMD_output_asis
(
spaceW
);
}
...
...
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