From c56b13bd2bc3d5ff5613700a5b57db25ea46f297 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 4 Apr 2003 20:33:05 +0000 Subject: [PATCH] work around popt bug Original commit message from CVS: work around popt bug --- tools/gst-launch.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/gst-launch.c b/tools/gst-launch.c index d237f2a..06980d1 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -182,6 +182,7 @@ fault_setup (void) int main(int argc, char *argv[]) { + gint i, j; /* options */ gboolean verbose = FALSE; gboolean no_fault = FALSE; @@ -215,6 +216,24 @@ main(int argc, char *argv[]) gst_init_with_popt_table (&argc, &argv, options); + /* FIXpopt: strip short args, too. We do it ourselves for now */ + j = 1; + for (i = 1; i < argc; i++) { + if (*(argv[i]) == '-') { + if (strlen (argv[i]) == 2) { + gchar *c = argv[i]; + c++; + if (*c == 'X' || *c == 'o') { + i++; + } + } + } else { + argv[j] = argv[i]; + j++; + } + } + argc = j; + if (!no_fault) fault_setup(); -- 2.7.4