Bug 25134 - [patch] 'add legacy application' broken
[patch] 'add legacy application' broken
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: kdebase (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
Florence Gold
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-28 08:53 EST by Tim Waugh
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-31 10:29:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
default-%f fixup (580 bytes, patch)
2001-01-30 18:04 EST, Tim Waugh
no flags Details | Diff
kdelibs-quote.patch (381 bytes, patch)
2001-01-31 09:38 EST, Tim Waugh
no flags Details | Diff

  None (edit)
Description Tim Waugh 2001-01-28 08:53:03 EST
When trying to add a 'legacy application' (pine) to my panel, by doing 
the following:

Right-click on panel
Add->Legacy Application
Navigate to /usr/bin, select pine, click OK
Check 'Run in terminal', click OK

I find that when clicking on the button, Pine goes straight to the 
Compose screen, and quits when I come out of it.

It's because KDE is actually invoking pine with a null argument, like

$ pine ''
Comment 1 Tim Waugh 2001-01-28 11:09:17 EST
The same happens when creating an entry in the menu using menu editor.
Comment 2 Glen Foster 2001-01-29 19:05:58 EST
This defect is considered MUST-FIX for Florence Gold release
Comment 3 Tim Waugh 2001-01-30 17:20:30 EST
I'm pretty sure this is because of KDE's broken '%f' handling.

The KDE authors seem to think that every UNIX command in the universe needs a 
filename to act on in its argument list, and so even if you purposefully omit 
a %f sequence it will thoughtfully append one for you.

So far, so crappy, but it shouldn't cause the bug.  The next problem comes in 
the expansion of %f.  'pine %f', when there is no file to act on, becomes 
["pine", ""].  It should be ["pine"], because to get a null parameter I should 
have to explicitly quote it, like 'pine "%f"'.

I guess that fixing this last bit would be enough to close this bug.  But I've 
now looked at the KDE Exec= expansion, and I think I can say without any 
controversy that it sucks rocks. ;-)

Comment 4 Tim Waugh 2001-01-30 18:04:00 EST
Created attachment 8521 [details]
default-%f fixup
Comment 5 Tim Waugh 2001-01-30 18:27:23 EST
I've tested that the above minimal fix [a single _bit_!] fixes the behaviour,
all except for the tooltip which still has extra space on the end (cmd + " " +
args).
Comment 6 Tim Waugh 2001-01-30 19:06:56 EST
Wait for bug 25307 before applying this patch though, as they touch the same
code.
Comment 7 Tim Waugh 2001-01-31 09:38:09 EST
Here is a better patch.  There might be trouble with 'blah "%f"' and things like
that, but really that whole section of KDE needs to be rewritten to think in
terms of a collection of words rather than a single command line to get all the
cases right.
Comment 8 Tim Waugh 2001-01-31 09:38:45 EST
Created attachment 8561 [details]
kdelibs-quote.patch
Comment 9 Bernhard Rosenkraenzer 2001-02-01 18:23:07 EST
Thanks for the patch, fixed.

Note You need to log in before you can comment on or make changes to this bug.