maziac / DeZog

Visual Studio Code Debugger for Z80/ZX Spectrum.
MIT License
212 stars 35 forks source link

ZRCP smartload command does not work with paths that contain path separators or whitespace #27

Closed breakintoprogram closed 4 years ago

breakintoprogram commented 4 years ago

Describe the bug If I put a path in the load key of the launch.json file, I get an error message like this:

ZEsarUX: smartload h:\My Code\Spectrum\Z80\Demo/area_51.sna => Error. Unknown file format

To Reproduce Steps to reproduce the behavior:

  1. Use a path in load rather than a filename, or one that contains whitespace
  2. See error returned to VSCode -or-
  3. Open ZEsarUX with ZRCP enabled on port 10000
  4. Open Telnet "telnet 127.0.0.1 10000"
  5. Enter the same path (with whitespace and/or separators), i.e. smartload h:\My Code\Spectrum\Z80\Demo/area_51.sna (change to a path on your system)
  6. See the returned error in Telnet

Expected behavior Expect to be able to use paths and whitespace in the load key

NB: Confirmed with ZEsarUX on Twitter that the smartload parameter accepts quotes Suggest wrapping the argument in quotes like this: smartload "h:\My Code\Spectrum\Z80\Demo/area_51.sna"

Screenshots N/A

Version etc. (please complete the following information):

Additional context Please attach your launch.json file.

{ "version": "0.2.0", "configurations": [ { "name": "Z80 Debugger", "type": "dezog", "request": "launch", "remoteType": "zrcp", "zrcp": { "hostname": "localhost", "port": 10000 }, "topOfStack": "Stack_Top", "rootFolder": "${workspaceFolder}", "listFiles": [ { "path": "${fileDirname}/${fileBasenameNoExtension}.lst", "asm": "sjasmplus", "useFiles": true, "mainFile": "${fileDirname}/${fileBasenameNoExtension}.z80", "srcDirs": [ "lib" ] } ], "disassemblerArgs": { "esxdosRst": true }, "load": "${fileDirname}/${fileBasenameNoExtension}.sna", "skipInterrupt": false, "startAutomatically": true, "preLaunchTask": "sjasmplus" } ] }

maziac commented 4 years ago

Interesting. I'm pretty sure that this was working in the past because I explicitly tested white spaces. But I can verify that it does not work (anymore). Will provide a fix. Thanks for reporting.

maziac commented 4 years ago

I provided a fix here: https://github.com/maziac/DeZog/releases/tag/v1.4.8 Please verify.

breakintoprogram commented 4 years ago

Thank you. I can confirm that is now working fine.