bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSProcessInfo's _gnu_process_args crash fix


From: Adam Fedor
Subject: Re: NSProcessInfo's _gnu_process_args crash fix
Date: Mon, 17 Feb 2003 16:20:36 -0700
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.1) Gecko/20020905



Tom Koelman wrote:
Hi,

Under MiNGQ _gnu_process_args crashes when argv is 0. This patch fixes
this and sets the executable to the empty string when this happens.


Wow. How often does this happen? It seems pretty strange to me.

@@ -191,10 +200,15 @@ _gnu_process_args(int argc, char *argv[]
   {
     NSMutableSet       *mySet;
     id                 obj_argv[argc];
-    int                        added = 0;
+    int                        added = 1;
mySet = [NSMutableSet new]; - for (i = 0; i < argc; i++) +
+    /* Copy the zero'th argument to the argument list */
+    NSString *str = [NSString stringWithCString: _gnu_arg_zero];
+    obj_argv[0] = str;
+ + for (i = 1; i < argc; i++) {
        NSString        *str = [NSString stringWithCString: argv[i]];

The documentation for the -arguments method is a little ambiguous. Is it supposed to include arg 0 or not?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]