Skip to content

Commit aa2809b

Browse files
ChillyVanilly77mirkobrombin
authored andcommitted
fix: change space-containing value(s) in Exec key of generated Desktop Entry file to be double- instead of single-quoted (in ManagerUtils.create_desktop_entry(…))
1 parent c89c611 commit aa2809b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bottles/backend/utils/manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,12 @@ def create_desktop_entry(
263263
for file in existing_files:
264264
os.remove(file)
265265

266+
# [Bug-]issue #4247 (single- to double-quotes in Desktop Entry spec -> "The Exec key"):
266267
with open(desktop_file, "w") as f:
267268
f.write("[Desktop Entry]\n")
268269
f.write(f"Name={program.get('name')}\n")
269270
f.write(
270-
f"Exec={cmd_cli} run -p {shlex.quote(program.get('name'))} -b '{config.get('Name')}' -- %u\n"
271+
f"Exec={cmd_cli} run -p \"{program.get('name')}\" -b \"{config.get('Name')}\" -- %u\n"
271272
)
272273
f.write("Type=Application\n")
273274
f.write("Terminal=false\n")
@@ -279,7 +280,7 @@ def create_desktop_entry(
279280
f.write("Actions=Configure;\n")
280281
f.write("[Desktop Action Configure]\n")
281282
f.write("Name=Configure in Bottles\n")
282-
f.write(f"Exec={cmd_legacy} -b '{config.get('Name')}'\n")
283+
f.write(f"Exec={cmd_legacy} -b \"{config.get('Name')}\"\n")
283284

284285
return True
285286
'''

0 commit comments

Comments
 (0)