# HG changeset patch # User Luke Schierer # Date 1062081567 0 # Node ID 0dfe02111e20b1a14058e3e7bd58785112179063 # Parent 8e03e9b54440dc663cfe96551b2216265043fde2 [gaim-migrate @ 7168] since it seems i cannot get Silvestrij's patch in for this release, bjoernv writes: " I found a number of bugs in src/gaim-remote.c. My patch contains: - parameter processing fix in gaim-remote (gaim-remote no longer segfaults on "gaim-remote uri") - gaim-remote now has correct error messages and return codes, if connection to gaim fails (gaim-remote is not longer silent, if gaim-remote uri 'aim:goim?screenname=Penguin&message=hello+world' failes, because gaim is not running)" committer: Tailor Script diff -r 8e03e9b54440 -r 0dfe02111e20 src/gaim-remote.c --- a/src/gaim-remote.c Thu Aug 28 01:32:15 2003 +0000 +++ b/src/gaim-remote.c Thu Aug 28 14:39:27 2003 +0000 @@ -111,20 +111,23 @@ else return 1; + if(opts.help) + return 0; + /* And we can have another argument--the URI. */ - if (optind < argc) { - /* but only if we're using the uri command. */ - if (!strcmp(opts.command, "uri")) + /* but only if we're using the uri command. */ + if (!strcmp(opts.command, "uri")) { + if(argc-optind==1) opts.uri = g_strdup(argv[optind++]); else return 1; - - /* and we can't have any others. */ - if (optind < argc) - return 1; } - - return 0; + else if(optind==argc) + return 0; + else + return 1; + + return 0; } @@ -132,7 +135,7 @@ int fd = 0; GaimRemotePacket *p = NULL; fd = gaim_remote_session_connect(0); - if (!fd) { + if (fd<0) { fprintf(stderr, _("Gaim not running (on session 0)\n")); return 1; } @@ -148,7 +151,7 @@ int fd = 0; GaimRemotePacket *p = NULL; fd = gaim_remote_session_connect(0); - if (!fd) { + if (fd<0) { fprintf(stderr, _("Gaim not running (on session 0)\n")); return 1; }