Diff of /src/main.c [38f5be] .. [dba5ed]  Maximize  Restore

Switch to side-by-side view

--- a/src/main.c
+++ b/src/main.c
@@ -96,24 +96,15 @@
 
   if (optind<argc) {
     int i;
-
-    for (i=optind; i<argc; i++)
+    for (i = optind; i < argc; ++i)
     {
-      char *mrl = argv[i];
-
-      if (mrl[0] != '/' && !strstr (mrl, ":/"))
-      {
-	/* make filename an absolute pathname */
-	char  buf[1024];
-	getcwd (buf, sizeof (buf));
-	mrl = g_strconcat (buf, "/", mrl, NULL);
-      }	
-
       if (autoplay && i == optind)
         server_client_send ("playlist_play (");
       server_client_send ("playlist_add (\"");
-      server_client_send (mrl);
+      char *uri = make_path_uri (argv[i]);
+      server_client_send (uri ? uri : argv[i]);
       server_client_send ((autoplay && i == optind) ? "\"));\n" : "\");\n");
+      free (uri);
     }
   }
 
@@ -411,12 +402,26 @@
 
   if (optstate & 2)
   {
-    g_printerr (_("gxine: invalid option (try -h or --help)"));
+    g_printerr (_("gxine: invalid option (try -h or --help)\n"));
     return 1;
   }
 
   if (optstate)
     return 0;
+
+  /*
+   * find out if gxine is already running, if so
+   * just pass on the files to play
+   */
+
+  gxine_try_remote (argc, argv, enqueue, autoplay);
+
+  /* start using X... */
+  if (!XInitThreads ())
+  {
+    g_printerr (_("gtkvideo: XInitThreads failed - looks like you don't have a thread-safe xlib.\n"));
+    return 2;
+  }
 
   /*
    * make sure ~/.gxine exists
@@ -431,20 +436,6 @@
 	   "Configuration, playlist and media marks will not be saved."),
 	 strerror (r));
     g_free (fname);
-  }
-
-  /*
-   * find out if gxine is already running, if so
-   * just pass on the files to play
-   */
-
-  gxine_try_remote (argc, argv, enqueue, autoplay);
-
-  /* start using X... */
-  if (!XInitThreads ())
-  {
-    g_printerr (_("gtkvideo: XInitThreads failed - looks like you don't have a thread-safe xlib.\n"));
-    return 2;
   }
 
   /*

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks