mingw fixup by Riccardo

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37568 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2014-01-10 15:41:28 +00:00
parent 6f23a9f315
commit 373e26b33e
2 changed files with 13 additions and 25 deletions

View file

@ -3,6 +3,8 @@
* Source/NSFileManager.m:
On mingw a file is executable if its extension is in the list
provided by the PATHEXT environment variable.
* Source/NSTask.m:
Simplification/clarification suggested by Riccardo
2014-01-08 Quentin Mathe <quentin.mathe@gmail.com>

View file

@ -771,32 +771,25 @@ pty_slave(const char* name)
arch_path = [arch_path stringByAppendingPathComponent: os];
full_path = [arch_path stringByAppendingPathComponent: libs];
lpath = [full_path stringByAppendingPathComponent: prog];
#ifdef __MINGW__
if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
#else
if ([mgr isExecutableFileAtPath: lpath] == NO)
/* As a convenience on windows, if the program was supplied without
* an extension (which means it can't be executable) try using the
* most common extension.
*/
if ([[prog pathExtension] length] == 0)
{
prog = [prog stringByAppendingPathExtension: @"exe"];
}
#endif
lpath = [full_path stringByAppendingPathComponent: prog];
if ([mgr isExecutableFileAtPath: lpath] == NO)
{
lpath = [arch_path stringByAppendingPathComponent: prog];
#ifdef __MINGW__
if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
#else
if ([mgr isExecutableFileAtPath: lpath] == NO)
#endif
{
lpath = [base_path stringByAppendingPathComponent: prog];
#ifdef __MINGW__
if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
#else
if ([mgr isExecutableFileAtPath: lpath] == NO)
#endif
{
/*
* Last resort - if the launch path was simply a program name
@ -809,14 +802,7 @@ pty_slave(const char* name)
}
if (lpath != nil)
{
#ifdef __MINGW__
if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])]
== NO)
#else
if ([mgr isExecutableFileAtPath: lpath] == NO)
#endif
{
lpath = nil;
}