Bug 94095 - Handle 'man: bash' (with space after semicolon) style urls
Summary: Handle 'man: bash' (with space after semicolon) style urls
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: man (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Stephan Kulow
Depends on:
Reported: 2004-11-29 11:40 UTC by Marcin Kasperski
Modified: 2011-01-05 23:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Kasperski 2004-11-29 11:40:42 UTC
Version:            (using KDE KDE 3.2.3)

Currently, attempt to open in konqueror url like
       man: bash
(note the space after semicolon!) result in the error claiming that bash is not found in manpath and that manpath can be extended via MANPATH variable setting. It is very confusing, especially considering that for instance on my Debian box MANPATH variable is not used at all (manpath file is in use), so it seems to be reasonable diagnosis.

I think that in case user enters 'man: bash', 'info: bash' or something similar, the space should just be ignored and the corresponding man or info page opened. It is natural to use the space in this place.

One can also consider improvement of this message in case the page really does not exist (say - man:bashhhh), so it accomodates situations when manpath is in use, not MANPATH.
Comment 1 Stephan Kulow 2004-11-29 18:33:46 UTC
I can fix that for man if you promise not to report a bug that http:// www.kde.org is not rendering kde's web page
Comment 2 Marcin Kasperski 2005-01-25 13:40:44 UTC
Additional remark: I noticed when I started using 'man: blah' syntax frequently - it happened just when I got used to using 'gg: something' as shortcut to google search.

As for the method of solving this bug, I would prefer 'man: ls' to present the correct manpage but if for some reason you dislike it, good error message ('unexpected space in the url, do you want man:ls ?') is acceptable too.
Comment 3 Nicolas Goutte 2005-05-16 00:40:37 UTC
Little question: you tell that the file is called manpath; however kio_man processes the file /etc/manpath.config for Debian.

Should that be fixed too?

Have a nice day!
Comment 4 Marcin Kasperski 2005-05-16 09:52:25 UTC
No, /etc/manpath.config is used on Debian too.
Comment 5 Nicolas Goutte 2005-05-19 12:47:19 UTC
SVN commit 415698 by goutte:

Better error when the man page is not found.
(The idea is that a (newbie) user does not start to fix its MANPATH
when the problem might only be a typo.)

 M  +6 -1      trunk/KDE/kdebase/kioslave/man/kio_man.cpp  

--- trunk/KDE/kdebase/kioslave/man/kio_man.cpp #415697:415698
@@ -444,7 +444,12 @@
     bool pageFound=true;
     if (foundPages.isEmpty())
-       outputError(i18n("No man page matching to %1 found. You can extend the search path by setting the environment variable MANPATH before starting KDE.").arg(title));
+       outputError(i18n("No man page matching to %1 found.<br><br>"
+           "Check that you have not mistyped the name of the page that you want.\n"
+           "Be careful that you must take care about upper case and lower case characters!<br>"
+           "If everything looks correct, then perhaps you need to set better the search path "
+           "for man pages, be it by the environment variable MANPATH or a matching file "
+           "in the directory /etc .").arg(title));
     else if (foundPages.count()>1)
Comment 6 Nicolas Goutte 2005-05-19 12:53:13 UTC
Just a question about comment #2 (but one that I have since I know this bug): why do you not use gg:something to search in Google. Therefore every URL in KDE would be of the same type: protocol:where

Have a nice day!
Comment 7 Alexander Neundorf 2006-01-17 20:55:48 UTC
Would you mind adding adding title=title.stripWhiteSpace() in kio_man.cpp parseUrl() ?? 
Comment 8 Marcin Kasperski 2006-04-27 11:21:54 UTC
One additional remark: note that in case of extra leading (or trailing) space the error message (both old and new) DOES NOT SHOW this space. For HTML presentation 'No man page matching bash' and 'No man page matching  bash' are displayed in exactly the same way. Therefore it could make sense to quote non-found page or do sth similar.

And, I still think that stripping whitespace before searching for the manpage would be the best way. What do the user who typed 'man: bash' want to see? He wants to see bash manpage. So why bother him with error messages if we can easily show him what he wanted to see....
Comment 9 Martin Koller 2011-01-05 23:28:58 UTC
SVN commit 1212148 by mkoller:

BUG: 94095
trim white space around the given URL so that "man:  bash " also shows the
bash man page.

Also use Qt's internal Qt::escape instead the self brewn one

 M  +3 -14     kio_man.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1212148
Comment 10 Martin Koller 2011-01-05 23:31:03 UTC
SVN commit 1212151 by mkoller:

Backport r1212148 by mkoller from trunk to the 4.6 branch:

CCBUG: 94095
trim white space around the given URL so that "man:  bash " also shows the
bash man page.

Also use Qt's internal Qt::escape instead the self brewn one

 M  +3 -14     kio_man.cpp  

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