Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2001 00:25:49 -0700 (PDT)
From:      Peter Johnson <freebsd@bilogic.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/31487: licq-qt-gui plugin does not parse local arguments correctly
Message-ID:  <200110250725.f9P7PnR31723@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         31487
>Category:       ports
>Synopsis:       licq-qt-gui plugin does not parse local arguments correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 25 00:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Johnson
>Release:        4.4-STABLE
>Organization:
>Environment:
FreeBSD bilogic.org 4.4-STABLE FreeBSD 4.4-STABLE #8: Fri Sep 28 18:39:47 CDT 2001     freebsd@bilogic.org:/usr/obj/usr/src/sys/WORKSTATION  i386

>Description:
Arguments to be passed to the qt-gui plugin to licq do not get parsed, except for -h (which is parsed separately).  Thus it's impossible to set the gui style using -g, for example, using a command line like "licq -p qt-gui -- -g GTK".
>How-To-Repeat:
Try to use the "local" qt-gui options when starting licq.
>Fix:
The cause is the getopt() call in CLicqGui::CLicqGui() in licq-1.0.3/plugins/qt-gui-1.0.3/src/licqgui.cpp, line 193.
As getopt() is called earlier in licq execution, it needs to be
reinitialized to work properly--if not reinitialized, the getopt() call
simply returns -1 on the first invocation, so none of the arguments are processed.

The fix is to add:
optreset=1;
optind=1;

immediately prior to the getopt() call.  These two assignments, as the
getopt(3) manpage notes, reset getopt() so it can be used a second time
in the same program.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110250725.f9P7PnR31723>