allow winebrowser to use commands with arguments

Yuriy yuriy.kozlov at gmail.com
Wed Jan 10 17:02:33 CST 2007


Hello,

Here is another try at the patch.
The attached patch allows using multi-argument commands for winebrowser and:
- keeps the current format (unlike the last patch)
- if there is a %s or %u, the url is placed there rather than at the end
- any number of arguments
- if a comma is needed, it can be inserted with %c (currently, there
is no way to have a comma)
- blank application values or extra spaces between arguments do not
cause problems
- uses strsep instead of parsing the string manually

An example winebrowser registry value:
"Browsers"=", ,x-www-browser,xdg-open,firefox %u, firefox -remote
openURL(%s%cnew-tab),kfmclient  openProfile webbrowsing
%s,konqueror,kfmclient openURL,mozilla,netscape,galeon,opera,dillo"

Any of the above will launch correctly with this patch.

CHANGELOG:
allow winebrowser to use commands with arguments


On 9/11/06, Yuriy <yuriy.kozlov at gmail.com> wrote:
> Hello,
>
> I have corrected some problems with the patch and accounted for more
> possibilities.  The attached patch allows using multi-argument
> commands for winebrowser and:
> - changes the browser list to a REG_MULTI_SZ value
> - if it is not a REG_MULTI_SZ, the old behavior remains for now
> - if there are arguments, the name of the browser should be in quotes
> - if there is a %s, the url is placed there rather than at the end
> - any number of arguments.
>
> On 8/11/06, Yuriy <yuriy.kozlov at gmail.com> wrote:
> > Hello,
> > I fixed a bug that wasn't allowing multi-word commands to be used as a
> > browser for winebrowser, which are needed for things such as launching
> > the KDE default browser or a new tab in opera.  This is my first time
> > writing more than a couple lines of C, so my patch probably warrants
> > some extra scrutiny.
> >
> >
> > PROBLEM:
> > winebrowser doesn't work with browsers/commands that
> > are more than one word.  For example, the command to run konqueror
> > with the webbrowsing profile on kubuntu is:
> >
> > kfmclient openProfile webbrowsing [url]
> >
> > Setting that to be the first attempted webbrowser in the registry:
> >
> > [HKEY_USERS\S-1-5-4\Software\Wine\WineBrowser]
> > "Browsers"="kfmclient openProfile webbrowsing,firefox,mozilla,opera,dillo"
> >
> > and running:
> > winebrowser http://www.winehq.org
> >
> > yields this:
> > Considering: kfmclient openProfile webbrowsing
> > argv[1]: http://www.winehq.org
> > Considering: firefox
> > argv[1]: http://www.winehq.org
> >
> >
> > DESCRIPTION:
> > This patch parses the app to seperate the arguments.  It allows up to
> > 5 arguments including the app name.  It sends all the arguments to the
> > spawn function and preserves the app name to display.
> >
> >
> > CHANGE:
> > allow winebrowser to use commands with arguments
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winebrowserarguments.diff
Type: application/octet-stream
Size: 3940 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070110/a5a71162/winebrowserarguments.obj


More information about the wine-patches mailing list