mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
move executable extensions code out to NSTask+GNUstepBase.m to avoid duplication
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37590 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e92bfba565
commit
f8006295b0
5 changed files with 93 additions and 93 deletions
|
@ -52,6 +52,7 @@
|
|||
#import "Foundation/NSURL.h"
|
||||
#import "Foundation/NSValue.h"
|
||||
#import "GNUstepBase/NSString+GNUstepBase.h"
|
||||
#import "GNUstepBase/NSTask+GNUstepBase.h"
|
||||
|
||||
#import "GSPrivate.h"
|
||||
|
||||
|
@ -318,34 +319,7 @@ AbsolutePathOfExecutable(NSString *path, BOOL atLaunch)
|
|||
|
||||
if (nil == executable)
|
||||
{
|
||||
NSMutableSet *m;
|
||||
|
||||
/* Get PATHEXT environment variable and split apart on ';'
|
||||
*/
|
||||
e = [[[[[NSProcessInfo processInfo] environment]
|
||||
objectForKey: @"PATHEXT"]
|
||||
componentsSeparatedByString: @";"] objectEnumerator];
|
||||
|
||||
m = [NSMutableSet set];
|
||||
while (nil != (s = [e nextObject]))
|
||||
{
|
||||
/* We don't have a '.' in a file extension, but the
|
||||
* environment variable probably does ... fix it.
|
||||
*/
|
||||
s = [s stringByTrimmingSpaces];
|
||||
if ([s hasPrefix: @"."])
|
||||
{
|
||||
s = [s substringFromIndex: 1];
|
||||
}
|
||||
if ([s length] > 0)
|
||||
{
|
||||
[m addObject: s];
|
||||
}
|
||||
}
|
||||
/* Make sure we at least have the EXE extension.
|
||||
*/
|
||||
[m addObject: @"EXE"];
|
||||
ASSIGNCOPY(executable, m);
|
||||
executable = [[NSTask executableExtensions] copy];
|
||||
}
|
||||
|
||||
e = [executable objectEnumerator];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue