Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=0ce239932c4b6807ccbd3cacda2b96f69f9c167e

commit 0ce239932c4b6807ccbd3cacda2b96f69f9c167e
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Tue Aug 31 13:12:17 2010 +0000

*fixes null args for vte

diff --git a/frugal-mono-tools/VteConsole.cs b/frugal-mono-tools/VteConsole.cs
index 13ea91a..a097f82 100644
--- a/frugal-mono-tools/VteConsole.cs
+++ b/frugal-mono-tools/VteConsole.cs
@@ -41,19 +41,23 @@ namespace frugalmonotools
}
public void Execute(string commande,string [] args)
{
+                       int i =0;
+                       string[] argv;
//encode to UTF8
-                       string[] argv = new string[args.Length];
byte[] commutf8 = System.Text.Encoding.UTF8.GetBytes(commande);
string commandev = System.Text.Encoding.UTF8.GetString(commutf8);
-
-                       int i =0;
-                       foreach (string arg in args)
+                       if (args==null)
+                               argv=new string[0];
+                       else
{
-                               byte[] utf8 = 
System.Text.Encoding.UTF8.GetBytes(arg);
-                               
argv[i]=System.Text.Encoding.UTF8.GetString(utf8);
-                               i++;
+                               argv = new string[args.Length];
+                               foreach (string arg in args)
+                               {
+                                       byte[] utf8 = 
System.Text.Encoding.UTF8.GetBytes(arg);
+                                       
argv[i]=System.Text.Encoding.UTF8.GetString(utf8);
+                                       i++;
+                               }
}
-
string[] envv = new string [Environment.GetEnvironmentVariables ().Count];
i = 0;
foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
@@ -64,7 +68,8 @@ namespace frugalmonotools
envv[i] = tmp;
i ++;
}
-
+                       try
+                       {
term.ForkCommand (
commandev,
argv,
@@ -73,6 +78,8 @@ namespace frugalmonotools
true,
true,
true);
+                       }
+                       catch{}

}
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to