iImprove last change

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27224 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2008-12-06 15:27:49 +00:00
parent 26a651d0bd
commit 958ad09e77
3 changed files with 6 additions and 9 deletions

View file

@ -1,8 +1,8 @@
2008-12-06 Richard Frith-Macdonald <rfm@gnu.org> 2008-12-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSCategories.m: ([setLaunchPathForTool:]) * Source/Additions/GSCategories.m: ([+launchPathForTool:])
Convenience method to locate a tool in the standard locations or in the Convenience method to locate a tool in the standard locations or in the
PATH and set it as the launch path of a task. PATH so that it can be used as the launch path of a task.
2008-12-05 Nicola Pero <nicola.pero@meta-innovation.com> 2008-12-05 Nicola Pero <nicola.pero@meta-innovation.com>

View file

@ -333,12 +333,12 @@ typedef enum _NSGNUstepStringEncoding
@end @end
@implementation NSTask (GSCategories) @implementation NSTask (GSCategories)
/** Sets the launch path given the name of a tool.<br /> /** Returns the launch path given the name of a tool.<br />
* Locates the tool by looking in the standard directories, * Locates the tool by looking in the standard directories,
* and failing that in the PATH set in the environment.<br /> * and failing that in the PATH set in the environment.<br />
* Returns the path set, or nil if the tool could not be located. * Returns the path found, or nil if the tool could not be located.
*/ */
- (NSString*) setLaunchPathForTool: (NSString*)name; + (NSString*) launchPathForTool: (NSString*)name;
@end @end
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------

View file

@ -1545,7 +1545,7 @@ executablePath(NSFileManager *mgr, NSString *path)
return nil; return nil;
} }
- (NSString*) setLaunchPathForTool: (NSString*)name + (NSString*) launchPathForTool: (NSString*)name
{ {
NSEnumerator *enumerator; NSEnumerator *enumerator;
NSDictionary *env; NSDictionary *env;
@ -1563,7 +1563,6 @@ executablePath(NSFileManager *mgr, NSString *path)
path = [path stringByAppendingPathComponent: name]; path = [path stringByAppendingPathComponent: name];
if ((path = executablePath(mgr, path)) != nil) if ((path = executablePath(mgr, path)) != nil)
{ {
[self setLaunchPath: path];
return path; return path;
} }
} }
@ -1574,7 +1573,6 @@ executablePath(NSFileManager *mgr, NSString *path)
path = [path stringByAppendingPathComponent: name]; path = [path stringByAppendingPathComponent: name];
if ((path = executablePath(mgr, path)) != nil) if ((path = executablePath(mgr, path)) != nil)
{ {
[self setLaunchPath: path];
return path; return path;
} }
} }
@ -1597,7 +1595,6 @@ executablePath(NSFileManager *mgr, NSString *path)
path = [path stringByAppendingPathComponent: name]; path = [path stringByAppendingPathComponent: name];
if ((path = executablePath(mgr, path)) != nil) if ((path = executablePath(mgr, path)) != nil)
{ {
[self setLaunchPath: path];
return path; return path;
} }
} }