My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 824 attachment: 0001-Make-editors-with-spaces-work.patch (815 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From e7f5caa97b476d6f209f22fb6e221d1dfd1166bb Mon Sep 17 00:00:00 2001
From: Dominic Mitchell <hdm@google.com>
Date: Thu, 26 Aug 2010 11:44:54 +0100
Subject: [PATCH] Make editors with spaces work.

---
editor.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/editor.py b/editor.py
index 23aab54..f23e42d 100644
--- a/editor.py
+++ b/editor.py
@@ -82,7 +82,9 @@ least one of these before using this command."""
fd = None

if re.compile("^.*[$ \t'].*$").match(editor):
- args = [editor + ' "$@"']
+ # We have to insert an extra argument, as the first argument after
+ # "sh -c 'foo'" is considered to be the argv[0] of the new process.
+ args = [editor + ' "$@"', 'argv0']
shell = True
else:
args = [editor]
--
1.7.1

Powered by Google Project Hosting