PATCH: Do not call xmalloc_failed in expandargv

DJ Delorie dj@redhat.com
Tue Sep 27 15:40:00 GMT 2005


>   	  if (!*argvp)
> ! 	    {
> ! 	      fprintf (stderr, "\n%sout of memory\n");
> ! 	      xexit (1);
> ! 	    }

I seem to recall a general policy (before my time) that libiberty
functions shouldn't ever exit on error; the proper response is to
return some error condition to the application.  Since expandargv()
doesn't have an error response, IMHO the right thing to do is treat
@foo as if it weren't a file and just return the original argv[n].
The application will hopefully discover the out of memory condition
itself and use its own handlers to deal with it.



More information about the Gdb mailing list