From 1b50f24d0611a9af0fdc878b51bdcb4fad38bbc5 Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 7 Dec 2008 05:36:37 +0000 Subject: [PATCH] remove unnecessary check git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27237 72102866-910b-0410-8b05-ffd578937521 --- Source/Additions/GSCategories.m | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Source/Additions/GSCategories.m b/Source/Additions/GSCategories.m index ac3e19e3a..7be59b2a9 100644 --- a/Source/Additions/GSCategories.m +++ b/Source/Additions/GSCategories.m @@ -1516,30 +1516,32 @@ newLockAt(Class self, SEL _cmd, id *location) static NSString* executablePath(NSFileManager *mgr, NSString *path) { +#if defined(__MINGW32__) + NSString *tmp; + if ([mgr isExecutableFileAtPath: path]) { return path; } -#if defined(__MINGW32__) - if ([path pathExtension] == nil) + tmp = [path stringByAppendingPathExtension: @"exe"]; + if ([mgr isExecutableFileAtPath: tmp]) { - NSString *tmp; - - tmp = [path stringByAppendingPathExtension: @"exe"]; - if ([mgr isExecutableFileAtPath: tmp]) - { - return tmp; - } - tmp = [path stringByAppendingPathExtension: @"com"]; - if ([mgr isExecutableFileAtPath: tmp]) - { - return tmp; - } - tmp = [path stringByAppendingPathExtension: @"cmd"]; - if ([mgr isExecutableFileAtPath: tmp]) - { - return tmp; - } + return tmp; + } + tmp = [path stringByAppendingPathExtension: @"com"]; + if ([mgr isExecutableFileAtPath: tmp]) + { + return tmp; + } + tmp = [path stringByAppendingPathExtension: @"cmd"]; + if ([mgr isExecutableFileAtPath: tmp]) + { + return tmp; + } +#else + if ([mgr isExecutableFileAtPath: path]) + { + return path; } #endif return nil;