GNOME Bugzilla – Bug 303166
g_option_context_parse loses '-'
Last modified: 2005-05-05 20:08:34 UTC
Version details: Debian's 2.6.4-1 GLib's option parser removes '-' from argv. This breaks programs which read from stdin (several GTK+ applications recently stopped working because of this). Test case: #include <stdio.h> #include <gtk/gtk.h> int main(int argc, char **argv) { GOptionContext *option_context; option_context = g_option_context_new (NULL); g_option_context_set_ignore_unknown_options (option_context, TRUE); printf("argv[1] = %s\n", argv[1]); g_option_context_parse (option_context, &argc, &argv, NULL); printf("argv[1] = %s\n", argv[1]); return 0; } This produces: $ cc `pkg-config --cflags --libs gtk+-2.0` t.c -o t $ ./t - argv[1] = - argv[1] = (null)
*** This bug has been marked as a duplicate of 168008 ***