http://bugs.winehq.org/show_bug.cgi?id=27778
Summary: TYPE outputs extraneous blank line after file contents Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: cmd AssignedTo: wine-bugs@winehq.org ReportedBy: frederic.delanoy@gmail.com
With the following code (make sure there's no space before the '>'):
echo bar> foo echo *** && type foo && echo ***
outputs *** bar ***
on windowses, but
*** bar
***
in wine
http://bugs.winehq.org/show_bug.cgi?id=27778
Frédéric Delanoy frederic.delanoy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase Platform|x86 |x86-64 Version|unspecified |1.3.24
http://bugs.winehq.org/show_bug.cgi?id=27778
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
--- Comment #1 from André H. nerv@dawncrow.de 2011-07-13 16:38:13 CDT --- maybe just
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 0352e59..f7411e2 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2523,7 +2523,7 @@ void WCMD_type (WCHAR *command) { errorlevel = 1; } else { if (writeHeaders) { - static const WCHAR fmt[] = {'\n','%','s','\n','\n','\0'}; + static const WCHAR fmt[] = {'\n','%','s','\n','\0'}; WCMD_output(fmt, thisArg); }
http://bugs.winehq.org/show_bug.cgi?id=27778
--- Comment #2 from Frédéric Delanoy frederic.delanoy@gmail.com 2011-07-13 16:56:38 CDT --- (In reply to comment #1)
maybe just
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 0352e59..f7411e2 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2523,7 +2523,7 @@ void WCMD_type (WCHAR *command) { errorlevel = 1; } else { if (writeHeaders) {
static const WCHAR fmt[] = {'\n','%','s','\n','\n','\0'};
static const WCHAR fmt[] = {'\n','%','s','\n','\0'}; WCMD_output(fmt, thisArg); }
Good try. Actually this was my first idea as well, doesn't work. In fact, it's used in (undocumented) TYPE multiple files mode (4ef2f8ba) where you use "TYPE foo bar". Now the "writeHeaders" name is a bit misleading... it should probably have been called "multipleFilesMode" or similar.
Think I found the problem: windows adds a newline when echo mode is on (and *not* when it's off). http://source.winehq.org/git/wine.git/commitdiff/78f38a742fb48a7233926876156... added implementation when echo mode is on. However, it also erroneously adds a newline when it's off, as is the case e.g. in test_builtins.cmd. I "simply" need to add the condition that the mode is "echo on" for the extra newline to be added.
(BTW "echo off" mode doesn't work in interactive mode... I'll probably add a bug for this if necessary)
http://bugs.winehq.org/show_bug.cgi?id=27778
Frédéric Delanoy frederic.delanoy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27782
http://bugs.winehq.org/show_bug.cgi?id=27778
Bug 27778 depends on bug 27782, which changed state.
Bug 27782 Summary: "echo off" does not work in cmd interactive mode http://bugs.winehq.org/show_bug.cgi?id=27782
What |Old Value |New Value ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
http://bugs.winehq.org/show_bug.cgi?id=27778
Frédéric Delanoy frederic.delanoy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #3 from Frédéric Delanoy frederic.delanoy@gmail.com 2011-07-15 12:54:59 CDT --- Fixed by http://source.winehq.org/git/wine.git/commitdiff/4b4dd300f6832be491610943b01...
http://bugs.winehq.org/show_bug.cgi?id=27778
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org 2011-07-22 12:44:33 CDT --- Closing bugs fixed in 1.3.25.
https://bugs.winehq.org/show_bug.cgi?id=27778
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |4b4dd300f6832be491610943b01 | |b80118f978c27