diff --git a/Source/NSPasteboard.m b/Source/NSPasteboard.m index 3a66542b4..96b48b557 100644 --- a/Source/NSPasteboard.m +++ b/Source/NSPasteboard.m @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -52,9 +53,6 @@ #include -#define stringify_it(X) #X -#define prog_path(X) stringify_it(X) "/Tools/gpbs" - @interface NSPasteboard (Private) + (id) _pbs; + (NSPasteboard*) _pasteboardWithTarget: (id)aTarget @@ -143,8 +141,17 @@ static NSMapTable *mimeMap = NULL; static NSString *cmd = nil; if (cmd == nil) - cmd = [NSString stringWithCString: - prog_path(GNUSTEP_INSTALL_PREFIX)]; + { +#ifdef GNUSTEP_BASE_LIBRARY + cmd = RETAIN([[NSSearchPathForDirectoriesInDomains( + GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0] + stringByAppendingPathComponent: @"gpbs"]); +#else + cmd = RETAIN([[@GNUSTEP_INSTALL_PREFIX + stringByAppendingPathComponent: @"Tools"] + stringByAppendingPathComponent: @"gpbs"]); +#endif + } [NSTask launchedTaskWithLaunchPath: cmd arguments: nil]; [NSTimer scheduledTimerWithTimeInterval: 5.0 invocation: nil