kov changed gksu/trunk/gksu/gksu.c

Gustavo Noronha kov at costa.debian.org
Tue Sep 13 02:34:26 UTC 2005


Mensagem de log: 
oops... my code really wants command to contain the command itself
before entering the for loop


-----


Modified: gksu/trunk/gksu/gksu.c
===================================================================
--- gksu/trunk/gksu/gksu.c	2005-09-13 02:26:00 UTC (rev 435)
+++ gksu/trunk/gksu/gksu.c	2005-09-13 02:34:25 UTC (rev 436)
@@ -1054,8 +1054,16 @@
 
     if (!strncmp ("--", command, 2))
       {
+	optind = optind + 1;
+
+	if (newargc <= optind)
+	  {
+	    gk_dialog (GTK_MESSAGE_ERROR, _("Missing command to run."));
+	    return 1;
+	  }
+
 	g_free (command);
-	command = g_strdup ("");
+	command = g_strdup (newargv[optind]);
       }
 
     for (i = optind + 1; i < newargc; i++)




More information about the gksu-commits mailing list