mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Workaround for bsd bug incorporated from dawn_6
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4817 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3cabe7ad0d
commit
593649fccc
1 changed files with 15 additions and 5 deletions
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
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];
|
_gnu_processName = [[NSString stringWithCString: argv[0]] lastPathComponent];
|
||||||
RETAIN(_gnu_processName);
|
RETAIN(_gnu_processName);
|
||||||
|
|
||||||
|
|
||||||
/* Copy the argument list */
|
/* Copy the argument list */
|
||||||
{
|
{
|
||||||
NSMutableSet *mySet;
|
NSMutableSet *mySet;
|
||||||
|
@ -268,6 +269,7 @@ static char **_gnu_noobjc_env;
|
||||||
int length;
|
int length;
|
||||||
int position;
|
int position;
|
||||||
int env_terms;
|
int env_terms;
|
||||||
|
BOOL stripTrailingNewline = NO;
|
||||||
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||||
extern char *program_invocation_name;
|
extern char *program_invocation_name;
|
||||||
#endif /* HAVE_PROGRAM_INVOCATION_NAME */
|
#endif /* HAVE_PROGRAM_INVOCATION_NAME */
|
||||||
|
@ -360,6 +362,16 @@ static char **_gnu_noobjc_env;
|
||||||
c = getc(ifp);
|
c = getc(ifp);
|
||||||
if ((c == EOF) || (c == 0)) // End of a parameter
|
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';
|
_gnu_noobjc_argv[argument][position] = '\0';
|
||||||
argument++;
|
argument++;
|
||||||
if (c == EOF) // End of command line
|
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
|
// $$$ The format of the string is not specified by the OpenStep
|
||||||
// specification. It could be useful to change this format after
|
// specification. It could be useful to change this format after
|
||||||
// NeXTSTEP release 4.0 comes out.
|
// NeXTSTEP release 4.0 comes out.
|
||||||
return [NSString stringWithFormat: @"%s: %d: [%s]",
|
return [NSString stringWithFormat: @"%@:%d:[%@]",
|
||||||
[[self hostName] cString],
|
[self hostName], pid, [NSDate date]];
|
||||||
pid,
|
|
||||||
[[[NSDate date] description] cString]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue