aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRune Halvorsen <runefh@gmail.com>2012-02-25 00:43:00 +0100
committerRune Halvorsen <runefh@gmail.com>2012-02-25 00:43:00 +0100
commitbbfdc7b7de21434cf14b639fd9e9d65c55cff530 (patch)
tree2b562fd6bc4eef23720548444205c0ca528c91ed
parentde08810a4748276cc09ffde19536945525f7c0be (diff)
downloadmitmproxy-bbfdc7b7de21434cf14b639fd9e9d65c55cff530.tar.gz
mitmproxy-bbfdc7b7de21434cf14b639fd9e9d65c55cff530.tar.bz2
mitmproxy-bbfdc7b7de21434cf14b639fd9e9d65c55cff530.zip
Use shlex to parse EDITOR.
-rw-r--r--libmproxy/console/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py
index 2039d7b1..5b2ec0cd 100644
--- a/libmproxy/console/__init__.py
+++ b/libmproxy/console/__init__.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import mailcap, mimetypes, tempfile, os, subprocess, glob, time
+import mailcap, mimetypes, tempfile, os, subprocess, glob, time, shlex
import os.path, sys
import urwid
from .. import controller, utils, flow, version
@@ -433,7 +433,8 @@ class ConsoleMaster(flow.FlowMaster):
#If no EDITOR is set, assume 'vi'
if not c:
c = "vi"
- cmd = [c, name]
+ cmd = shlex.split(c)
+ cmd.append(name)
self.ui.stop()
try:
subprocess.call(cmd)