work around popt bug
authorBenjamin Otte <otte@gnome.org>
Fri, 4 Apr 2003 20:33:05 +0000 (20:33 +0000)
committerBenjamin Otte <otte@gnome.org>
Fri, 4 Apr 2003 20:33:05 +0000 (20:33 +0000)
Original commit message from CVS:
work around popt bug

tools/gst-launch.c

index d237f2a..06980d1 100644 (file)
@@ -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();