diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 63620b3fc..366cfd32d 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -19,7 +19,7 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ /************************************************************************* @@ -160,6 +160,7 @@ _gnu_process_args(int argc, char *argv[], char *env[]) _gnu_processName = [[NSString stringWithCString: argv[0]] lastPathComponent]; RETAIN(_gnu_processName); + /* Copy the argument list */ { NSMutableSet *mySet; @@ -268,6 +269,7 @@ static char **_gnu_noobjc_env; int length; int position; int env_terms; + BOOL stripTrailingNewline = NO; #ifdef HAVE_PROGRAM_INVOCATION_NAME extern char *program_invocation_name; #endif /* HAVE_PROGRAM_INVOCATION_NAME */ @@ -360,6 +362,16 @@ static char **_gnu_noobjc_env; c = getc(ifp); if ((c == EOF) || (c == 0)) // End of a parameter { + if (argument == 0 && position > 0 + && _gnu_noobjc_argv[argument][position-1] == '\n') + { + stripTrailingNewline = YES; + } + if (stripTrailingNewline == YES && position > 0 + && _gnu_noobjc_argv[argument][position-1] == '\n') + { + position--; + } _gnu_noobjc_argv[argument][position] = '\0'; argument++; if (c == EOF) // End of command line @@ -554,10 +566,8 @@ int main(int argc, char *argv[], char *env[]) // $$$ The format of the string is not specified by the OpenStep // specification. It could be useful to change this format after // NeXTSTEP release 4.0 comes out. - return [NSString stringWithFormat: @"%s: %d: [%s]", - [[self hostName] cString], - pid, - [[[NSDate date] description] cString]]; + return [NSString stringWithFormat: @"%@:%d:[%@]", + [self hostName], pid, [NSDate date]]; } /*************************************************************************