After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 168008 - gtk_init() strips "-" from parameters list
gtk_init() strips "-" from parameters list
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 301534 303166 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-21 02:12 UTC by tpgww
Modified: 2011-02-18 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description tpgww 2005-02-21 02:12:47 UTC
Version details: 2.6.2
Distribution/Version: Mandrake 10.1

any "-" (by itself, i.e. not "-something") in argv[] sent to gtk_init() is
stripped, with corresponding change to argc. Makes life difficult for apps.
wanting input from stdin.
Comment 1 Matthias Clasen 2005-02-21 03:35:05 UTC
Does it work with -- ? 
Comment 2 tpgww 2005-02-21 05:20:08 UTC
Embedded "--" is ignored, trailing "--" is stripped. As contrasted with "-",
which is removed from anywhere.
Comment 3 Tim Musson 2005-03-04 11:02:05 UTC
Before GTK 2.6, gtk_init did not remove "-" from argv.

Letting gtk_init (etc.) silently remove "-" from argv (for no obvious reason and
without documentation) limits how well new GTK applications can clone older X
applications.

(E.g., my gxmessage app can't clone xmessage decently, if the "-file -" option
isn't going to work without me implementing a kludge. :)

Is there a reason for gtk_init to remove "-" from argv?
Comment 4 Owen Taylor 2005-03-04 13:22:52 UTC
What does "xmessage --display :0" give you :-)

If you want to clone Xt command line processing, you are going to 
have to call gtk_init(NULL, NULL);
Comment 5 Matthias Clasen 2005-04-06 15:43:18 UTC
Moving to GLib, since this is a GOption issue.
Comment 6 Matthias Clasen 2005-05-05 20:08:35 UTC
*** Bug 303166 has been marked as a duplicate of this bug. ***
Comment 7 Matthias Clasen 2005-05-06 19:46:24 UTC
*** Bug 301534 has been marked as a duplicate of this bug. ***
Comment 8 Matthias Clasen 2005-05-06 20:12:07 UTC
2005-05-06  Matthias Clasen  <mclasen@redhat.com>

	* tests/option-test.c: Add a testcase.
	
	* glib/goption.c (g_option_context_parse): Treat '-'
	on its own as a non-option argument.  (#168008, Tim Musson,
	Thomas Leonard and others)