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 <code@justinschuh.com>
  • Loading branch information
jschuh committed Mar 18, 2022
1 parent fe2974b commit ea18cd2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions klippy/extras/virtual_sdcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,7 @@ 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 filename.startswith('/'):
filename = filename[1:]
self._load_file(gcmd, filename)
Expand Down

0 comments on commit ea18cd2

Please sign in to comment.