Merge lp:~rosslagerwall/bzr/cmdline-empty-quotes into lp:bzr

Proposed by Ross Lagerwall
Status: Merged
Merged at revision: 6578
Proposed branch: lp:~rosslagerwall/bzr/cmdline-empty-quotes
Merge into: lp:bzr
Diff against target: 26 lines (+5/-0)
2 files modified
bzrlib/ (+1/-0)
bzrlib/tests/ (+4/-0)
To merge this branch: bzr merge lp:~rosslagerwall/bzr/cmdline-empty-quotes
Reviewer Review Type Date Requested Status
Richard Wilbur Approve
Review via email:

Description of the change

This branch fixes up parsing of command lines like EDITOR='emacsclient -a "" -t' which are currently handled incorrectly.

To post a comment you must log in.
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Looks good. Is this written up as a bug? If so please add a reference to the bug number.

review: Approve
Revision history for this message
Ross Lagerwall (rosslagerwall) wrote :

No, I didn't open a bug for it (I haven't searched for one though).

Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

I looked for bugs with "empty string", "empty quotes" and didn't find this problem. Would you like to open a bug for it? I don't know your context in order to fill in the bug info.

Revision history for this message
Ross Lagerwall (rosslagerwall) wrote :

Ok, I wrote a bug and linked it to this branch.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Landing with an added news entry on both 2.5 and trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/'
--- bzrlib/ 2011-12-19 13:23:58 +0000
+++ bzrlib/ 2012-12-10 14:57:21 +0000
@@ -72,6 +72,7 @@
72 if next_char == u'\\':72 if next_char == u'\\':
73 return _Backslash(self)73 return _Backslash(self)
74 elif next_char == self.quote_char:74 elif next_char == self.quote_char:
75 context.token.append(u'')
75 return self.exit_state76 return self.exit_state
76 else:77 else:
77 context.token.append(next_char)78 context.token.append(next_char)
=== modified file 'bzrlib/tests/'
--- bzrlib/tests/ 2010-12-06 14:01:44 +0000
+++ bzrlib/tests/ 2012-12-10 14:57:21 +0000
@@ -66,6 +66,10 @@
66 self.assertAsTokens([(True, '')], u'""')66 self.assertAsTokens([(True, '')], u'""')
67 self.assertAsTokens([(False, u"''")], u"''")67 self.assertAsTokens([(False, u"''")], u"''")
68 self.assertAsTokens([(True, '')], u"''", single_quotes_allowed=True)68 self.assertAsTokens([(True, '')], u"''", single_quotes_allowed=True)
69 self.assertAsTokens([(False, u'a'), (True, u''), (False, u'c')],
70 u'a "" c')
71 self.assertAsTokens([(False, u'a'), (True, u''), (False, u'c')],
72 u"a '' c", single_quotes_allowed=True)
70 def test_unicode_chars(self):74 def test_unicode_chars(self):
71 self.assertAsTokens([(False, u'f\xb5\xee'), (False, u'\u1234\u3456')],75 self.assertAsTokens([(False, u'f\xb5\xee'), (False, u'\u1234\u3456')],