Bug 188230 - konsole command line parsing in profile broken (number of unquoted spaces is not ignored)
Summary: konsole command line parsing in profile broken (number of unquoted spaces is ...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.2.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-27 09:15 UTC by Achim Bohnet
Modified: 2009-07-07 14:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
test script (76 bytes, application/x-shellscript)
2009-03-27 09:16 UTC, Achim Bohnet
Details
test okay profile (244 bytes, text/plain)
2009-03-27 09:18 UTC, Achim Bohnet
Details
test autsch profile, that has several spaces in the command line field (250 bytes, text/plain)
2009-03-27 09:19 UTC, Achim Bohnet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2009-03-27 09:15:02 UTC
Version:           2.2.1 (using 4.2.1 (KDE 4.2.1), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.28-11-generic

To reproduce:

test script that prints it's command line arguments:

$ cat /usr/local/bin/listargs
#!/bin/bash
echo -n args:
for a; do
        echo -n " <$1>"
        shift
done
echo
read


and my two test profile that differ in the number of unquoted spaces in the command line of the profile:

diff -u .kde/share/apps/konsole/test*
--- .kde/share/apps/konsole/test autsch.profile 2009-03-27 08:53:28.000000000 +0100
+++ .kde/share/apps/konsole/test okay.profile   2009-03-27 08:52:54.000000000 +0100
@@ -3,8 +3,8 @@
 Font=DejaVu Sans Mon,10,-1,2,50,0,0,0,0,0

 [General]
-Command=listargs  foo  bar   "bla bla"
-Name=test autsch
+Command=listargs foo bar "bla bla"
+Name=test okay
 Parent=FALLBACK/
 RemoteTabTitleFormat=%h : %u
 ShowNewAndCloseTabButtons=true


Output of profile 'test okay' in konsole:

args: <foo> <bar> <bla bla>

Output of profile 'test autsch' in konsole:

args: <> <foo> <> <bar> <> <> <bla bla>

That's IMHO a bug 'test autsch' should give the same result as 'test okay'.  Shells always split on word boundries and never cared about
more than one unquoted white space.  No. of spaces in command line
field is hard to spot for the user.

Achim
Comment 1 Achim Bohnet 2009-03-27 09:16:16 UTC
Created attachment 32425 [details]
test script
Comment 2 Achim Bohnet 2009-03-27 09:18:18 UTC
Created attachment 32426 [details]
test okay profile
Comment 3 Achim Bohnet 2009-03-27 09:19:25 UTC
Created attachment 32427 [details]
test autsch profile, that has several spaces in the command line field
Comment 4 Kurt Hindenburg 2009-06-30 00:45:44 UTC
I have a patch for this.  Let me test it some more.

ShellCommand::ShellCommand()

_arguments = KShell::splitArgs(fullCommand);
Comment 5 Kurt Hindenburg 2009-07-07 14:50:32 UTC
SVN commit 992625 by hindenburg:

Correct (and simplify) command parsing in profiles with respect to spaces.

BUG: 188230


 M  +2 -25     ShellCommand.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=992625