[Bug 56381] New: "type" does not support binary files
https://bugs.winehq.org/show_bug.cgi?id=56381 Bug ID: 56381 Summary: "type" does not support binary files Product: Wine Version: 9.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs(a)winehq.org Reporter: dan(a)coneharvesters.com Distribution: --- "type" truncates binary files when redirecting the output to stdout. For example: c:\>type c:\windows\winhelp.exe >foo c:\>dir c:\windows\winhelp.exe foo Volume in drive c has no label. Volume Serial Number is 0000-0000 Directory of c:\windows 28/02/2022 5:32 PM 257 winhelp.exe 1 file 257 bytes 0 directories Directory of c: 29/02/2024 1:21 PM 2 foo 1 file 2 bytes 0 directories 19,394,506,752 bytes free The file is truncated after the second byte (byte 3 is NUL). Windows 10 and Windows XP copy the entire file in this case. However, Windows 95 truncates the file. This is causing real-world compatibility issues, as the z88dk compiler suite inexplicably uses "type" to copy binary files like this on Windows. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=56381 JoeS <jsouza(a)geocities.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsouza(a)geocities.com --- Comment #1 from JoeS <jsouza(a)geocities.com> --- Just noting that the truncation occurs whether redirecting output or not. type c:\windows\winhelp.exe displays only the first two bytes of the file. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=56381 --- Comment #2 from JoeS <jsouza(a)geocities.com> --- The problem here is that Wine assumes that TYPE will be displaying text and attempts to convert the read text to Unicode. This text conversion stops at the NUL character because that is the end of the text file. Native Win10 TYPE command does not seem to handle Unicode and displays Unicode text as single-byte characters which appear to be gibberish, at least in U.S. page codes. To fix this, Wine's TYPE command would probably need to be rewritten to read and display the text as single-byte characters. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=56381 --- Comment #3 from JoeS <jsouza(a)geocities.com> --- Also note that I don't know how the TYPE command operates on Far East code pages which handle Unicode by default. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=56381 --- Comment #4 from JoeS <jsouza(a)geocities.com> --- I am working on a fix for this. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=56381 Eric Pouech <eric.pouech(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |edd5b62380a91caa09866a63932 | |9928e06930a2e Resolution|--- |FIXED CC| |eric.pouech(a)gmail.com Status|UNCONFIRMED |RESOLVED --- Comment #5 from Eric Pouech <eric.pouech(a)gmail.com> --- fixed by edd5b62380a91caa09866a639329928e06930a2e (note: there are cornerish cases not fully handled, esp. when redirecting type's output to console) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=56381 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #6 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 10.17. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla