Skip to content

Commit ee19d4e

Browse files
committed
frontend: cli: run_porgram: Quote passed args
Will allow pass symbols like &
1 parent 31f8a68 commit ee19d4e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bottles/frontend/cli/cli.in

+8-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import sys
2424
import uuid
2525
import json
2626
import signal
27+
import shlex
2728
import argparse
2829
import warnings
2930

@@ -538,7 +539,7 @@ class CLI:
538539
_bottle = self.args.bottle
539540
_program = self.args.program
540541
_keep = self.args.keep_args
541-
_args = " ".join(self.args.args)
542+
_args = self.args.args
542543
_executable = self.args.executable
543544
_cwd = None
544545
_script = None
@@ -570,7 +571,9 @@ class CLI:
570571
program = [p for p in programs if p["name"] == _program][0]
571572
_executable = program.get("path", "")
572573
if _keep:
573-
_args = program.get("arguments", "") + " " + _args
574+
default_args = program.get("arguments", "")
575+
if "".__ne__(default_args):
576+
_args.insert(0, default_args)
574577
_cwd = program.get("folder", "")
575578
_script = program.get("script", None)
576579

@@ -587,10 +590,12 @@ class CLI:
587590
if program.get("virtual_desktop") != _virt_desktop:
588591
_virt_desktop = program.get("virtual_desktop")
589592

593+
_args_string = shlex.join(_args)
594+
590595
WineExecutor(
591596
bottle,
592597
exec_path=_executable,
593-
args=_args,
598+
args=_args_string,
594599
cwd=_cwd,
595600
post_script=_script,
596601
override_dxvk=_dxvk,

0 commit comments

Comments
 (0)