dosemu2 / comcom64

64bit command.com
https://github.com/dosemu2/comcom32/
GNU General Public License v3.0
32 stars 5 forks source link

Copy doesn't allow wildcard * on destination #62

Closed haenschen closed 2 years ago

haenschen commented 2 years ago

Describe the bug Copy doesn't allow wildcard * on destination

To Reproduce

copy file1.1 *.dat
Illegal wildcard on destination

Expected behaviour

copy file1.1 *.dat
file1.1 =>> file1.dat

Attach program/game binaries or provide an URL Works with freecom and MS-DOS command.com

A regression? With comcom32

stsp commented 2 years ago

Added some hackish wildcard support.

haenschen commented 2 years ago

Thanks. I tested it, but it doesn't work as expected. Let's say I'm in a directory test1 and want to copy files from a subdirectory test2 into this one: copy test2\*.* *.* Fails with Unable to open destination file - c:\TEST1\*xt.*u

haenschen commented 2 years ago

To be fair, this case wasn't represented in my initial report :)

stsp commented 2 years ago
C:\T>copy c:\ctmouse\*.* *.*
PROTOCOL.COM copied to c:\T\
CTM-IT.EXE copied to c:\T\
CTM-HU.EXE copied to c:\T\
CTM-SK.EXE copied to c:\T\
CTM-LV.EXE copied to c:\T\
COMTEST.COM copied to c:\T\
CTMOUSE.EXE copied to c:\T\
CTM-FR.EXE copied to c:\T\
MOUSETST.COM copied to c:\T\
COM2EXE.EXE copied to c:\T\
CTM-DE.EXE copied to c:\T\
CTM-PT.EXE copied to c:\T\
CTM-ES.EXE copied to c:\T\
CTM-BR.EXE copied to c:\T\
CTM-EN.EXE copied to c:\T\
CTMDEBUG.EXE copied to c:\T\
CTM-PL.EXE copied to c:\T\
CTM-NL.EXE copied to c:\T\
       18 file(s) copied               
C:\T>ver /r
comcom32 v0.1
 Source Control Revision ID: alpha-3-15-g90fdd04

Reported DOS version (Int21.3000): 5.00 OEM: FDh
Reported true DOS version (Int21.3306): 7.10
Version string (Int21.33FF): FDPP kernel 1.6 [GIT: 1.6-27-g58a3acf] (compiled Sep 12 2022
haenschen commented 2 years ago

Ah, I see. So it has to do with a previous command. To reproduce, create a batch file

if exist test2\file1.1 copy test2\file1.1 file1.dat
copy test2\*.* *.*

and call it.

Provided the first if clause succeeds the second copy will fail with

Unable to open destination file - c:\TEST1\*le1.*

Test case attached copytest.zip

stsp commented 2 years ago

Should now be fixed.