• R/O
  • SSH

execsql: Commit

Default repository for execsql.py


Commit MetaInfo

Révision06592179c6e43f9365ee41309e2a81519e22a4f2 (tree)
l'heure2021-11-06 04:11:47
AuteurDreas Nielsen <dnielsen@inte...>
CommiterDreas Nielsen

Message de Log

Modified quoting of arguments with ampersands in SYSTEM_CMD.

Change Summary

Modification

diff -r b32d9705dfc1 -r 06592179c6e4 execsql/execsql.py
--- a/execsql/execsql.py Mon Oct 25 06:13:48 2021 -0700
+++ b/execsql/execsql.py Fri Nov 05 12:11:47 2021 -0700
@@ -27,12 +27,12 @@
2727 #
2828 # ===============================================================================
2929
30-__version__ = "1.94.2"
31-__vdate = "2021-10-22"
30+__version__ = "1.94.3"
31+__vdate = "2021-11-05"
3232
3333 primary_vno = 1
3434 secondary_vno = 94
35-tertiary_vno = 2
35+tertiary_vno = 3
3636
3737 import os
3838 import os.path
@@ -797,6 +797,9 @@
797797 return w2
798798
799799
800+def is_doublequoted(s):
801+ return len(s) > 1 and s[0] == '"' and s[-1] == '"'
802+
800803 def unquoted(phrase, quotechars='"'):
801804 # Removes all quote characters in the given string only if they are paired
802805 # at the beginning and end of the string.
@@ -10834,8 +10837,10 @@
1083410837 cont = kwargs['continue']
1083510838 if os.name != 'posix':
1083610839 syscmd = syscmd.replace("\\", "\\\\")
10837- cmdlist = shlex.split(syscmd)
10838- cmdargs = ['"'+cmd+'"' if '&' in cmd else cmd for cmd in cmdlist]
10840+ cmdlist = shlex.split(syscmd)
10841+ else:
10842+ cmdlist = shlex.split(syscmd, posix=False)
10843+ cmdargs = ['"'+cmd+'"' if '&' in cmd and not is_doublequoted(cmd) else cmd for cmd in cmdlist]
1083910844 if cont is None:
1084010845 returncode = subprocess.call(cmdargs)
1084110846 subvars.add_substitution('$SYSTEM_CMD_EXIT_STATUS', str(returncode))
Afficher sur ancien navigateur de dépôt.