Skip to content

Commit

Permalink
virtual_sdcard: Allow spaces in file path for M23
Browse files Browse the repository at this point in the history
Also makes M23 work normally with rename_existing.

Signed-off-by: Justin Schuh <[email protected]>
  • Loading branch information
jschuh committed Mar 17, 2022
1 parent fe2974b commit 53f8c3c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions klippy/extras/virtual_sdcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,9 @@ def cmd_M23(self, gcmd):
if self.work_timer is not None:
raise gcmd.error("SD busy")
self._reset_file()
try:
orig = gcmd.get_commandline()
filename = orig[orig.find("M23") + 4:].split()[0].strip()
if '*' in filename:
filename = filename[:filename.find('*')].strip()
except:
raise gcmd.error("Unable to extract filename")
filename = gcmd.get_raw_command_parameters().strip()
if '*' in filename:
filename = filename[:filename.find('*')].strip()
if filename.startswith('/'):
filename = filename[1:]
self._load_file(gcmd, filename)
Expand Down

0 comments on commit 53f8c3c

Please sign in to comment.