GNOME Bugzilla – Bug 136242
Documentation/usage mismatch
Last modified: 2004-12-22 21:47:04 UTC
The documentation for libgnome gnome_help_display tells me the first argument should be a filename. Running under strace I found that the library is trying to use the first argument as a directory. Luckily, the library is smart enough to strip the filename of its extension and try that as well. Unfortunately, it tries a lot of gnome/help/conglomerate.xml/C/ paths before it does that. It would be nice if the documentation and the behaviour were made to match and the documented method was the one tried first.
If you look at the source, the function in question does match the documentation, but it just calls another function that has two more args before the filename given in the first function. Can we close this or do you still think there's a problem here?
Created attachment 25999 [details] [review] Change the search order of extensions on the help file How about this patch to libgnome/gnome-help.c locate_help_file()? It just changes the search order of extensions so we search for the specified filename without an additional extension first. Since the documentation specifies that we're supposed to specify a filename, properly written code should already have the proper extension tacked on. It's a really small nit-pick; I just like to see code that optimizes for the case where the programmer follows the documented interface. (Note: Untested but looks safe)
I've committed this patch to HEAD, thanks.