[Goodies-commits] r3413 - xfce4-smartpm-plugin/trunk/src

Anders F Bjorklund afb at xfce.org
Sat Oct 20 12:25:35 CEST 2007


Author: afb
Date: 2007-10-20 10:25:35 +0000 (Sat, 20 Oct 2007)
New Revision: 3413

Modified:
   xfce4-smartpm-plugin/trunk/src/xfcesmart.c
Log:
simplify program_exists

Modified: xfce4-smartpm-plugin/trunk/src/xfcesmart.c
===================================================================
--- xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-20 10:14:01 UTC (rev 3412)
+++ xfce4-smartpm-plugin/trunk/src/xfcesmart.c	2007-10-20 10:25:35 UTC (rev 3413)
@@ -675,15 +675,7 @@
 static gboolean
 smart_program_exists(gchar *program)
 {
-  gchar *path = "/usr/bin"; /* TODO: check PATH */
-  gchar *bin;
-  gboolean ok;
-  
-  bin = g_strdup_printf("%s/%s", path, program);
-  ok = g_file_test(bin, G_FILE_TEST_EXISTS);
-  g_free(bin);
-
-  return ok;
+  return g_file_test(bin, G_FILE_TEST_EXISTS);
 }
 
 static void
@@ -696,8 +688,8 @@
   switch (smart->package_manager)
   {
     case PACKAGE_MANAGER_SMART:
-      if (smart_program_exists(SMART_SUIDBIN))
-        program = g_strdup(SMART_SUIDBIN);
+      if (smart_program_exists("/usr/sbin/" SMART_SUIDBIN))
+        program = g_strdup("/usr/sbin/" SMART_SUIDBIN);
       else if (smart_program_exists(PATH_GKSUDO))
         program = g_strdup_printf("%s -- %s", PATH_GKSUDO, SMART_PROGRAM);
       else




More information about the Goodies-commits mailing list