Merge lp:~xanderfomin/pantheon-terminal/fix-1324577 into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Alexander Fomin
Status: Rejected
Rejected by: Sergey "Shnatsel" Davidoff
Proposed branch: lp:~xanderfomin/pantheon-terminal/fix-1324577
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 21 lines (+6/-2)
1 file modified
src/TerminalWidget.vala (+6/-2)
To merge this branch: bzr merge lp:~xanderfomin/pantheon-terminal/fix-1324577
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+221611@code.launchpad.net

Description of the change

There was a problem in process_argv() method for commands that consist from one string, because in the latter case (bin_path + " " + tmp[1]).split(" ") returns [bin_path, ""] array, but not [bin_path] which is expected.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) :
577. By Alexander Fomin

Code style fixed

Revision history for this message
Alexander Fomin (xanderfomin) :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

This indeed does fix the bug. Thanks!

However, the code written before you came around looks superfluous to me. Now that you've tracked down the cause of the bug, I'll see if I can rewrite it better.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I'm marking this merge request "Rejected" because https://code.launchpad.net/~elementary-apps/pantheon-terminal/fix-1324577-with-cleanup/+merge/222077 based on this work was merged.

Thanks again for fixing the bug!

Revision history for this message
Alexander Fomin (xanderfomin) wrote :

That's OK.

Unmerged revisions

577. By Alexander Fomin

Code style fixed

576. By Alexander Fomin

Command execution via "--execute" fixed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/TerminalWidget.vala'
2--- src/TerminalWidget.vala 2014-05-19 20:00:57 +0000
3+++ src/TerminalWidget.vala 2014-05-31 16:06:15 +0000
4@@ -404,10 +404,14 @@
5 string[] tmp = path.split (" ", 2);
6 string? bin_path = GLib.Environment.find_program_in_path (tmp[0]);
7 if (path != null) {
8- return (bin_path + " " + tmp[1]).split (" ");
9+ if (tmp.length == 1) {
10+ return { bin_path };
11+ } else {
12+ return (bin_path + " " + tmp[1]).split (" ");
13+ }
14 } else {
15 return null;
16 }
17 }
18 }
19-}
20\ No newline at end of file
21+}

Subscribers

People subscribed via source and target branches