some fixes from jdahlin
authorThomas Vander Stichele <thomas@apestaart.org>
Thu, 19 Feb 2004 10:36:06 +0000 (10:36 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Thu, 19 Feb 2004 10:36:06 +0000 (10:36 +0000)
Original commit message from CVS:
some fixes from jdahlin

ChangeLog
tools/gst-run.c

index 3bd2e16..a7e10be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-19  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * tools/gst-run.c: (get_candidates), (main): some fixes from jdahlin
+
 2004-02-18  kost@imn.htwk-leipzig.de
 
        reviewed by: David Schleef  <ds@schleef.org>
index 4ed064a..b5bc2a5 100644 (file)
@@ -237,7 +237,7 @@ get_candidates (const gchar * dir, const gchar * base)
 
   /* get all dirs from the path and prepend with given dir */
   path = g_strdup_printf ("%s%c%s",
-                          dir, G_SEARCHPATH_SEPARATOR, getenv ("PATH"));
+                          dir, G_SEARCHPATH_SEPARATOR, g_getenv ("PATH"));
   dirs = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, 0);
   g_free (path);
 
@@ -311,7 +311,7 @@ int main
   ctx = poptGetContext ("gst-run", argc, (const char **) argv, options, 0);
   poptReadDefaultConfig (ctx, TRUE);
   while ((nextopt = poptGetNextOpt (ctx)) > 0)
-    ;
+    /* keep looping to parse */;
 
   argc = poptStrippedArgv (ctx, argc, argv);
   argv[argc] = NULL;
@@ -353,6 +353,8 @@ int main
     binary = g_strdup_printf ("%s-%s", base, highest);
   }
 
+  g_free (base);
+
   path = g_build_filename (dir, binary, NULL);
   g_free (binary);
 
@@ -361,6 +363,7 @@ int main
   if (_arg_list_mm)
   {
     g_hash_table_foreach (candidates, (GHFunc) hash_print_key, NULL);
+    g_hash_table_destroy (candidates);
     return 0;
   }