#OTHER by cg
authorClaus Gittinger <cg@exept.de>
Tue, 27 Sep 2016 15:09:44 +0200
changeset 20460 4831c0d89182
parent 20459 bcf7672c33ad
child 20461 cfd271409c54
#OTHER by cg class: UnixOperatingSystem changed: #pathOfCommand: oops
UnixOperatingSystem.st
--- a/UnixOperatingSystem.st	Tue Sep 27 15:05:45 2016 +0200
+++ b/UnixOperatingSystem.st	Tue Sep 27 15:09:44 2016 +0200
@@ -3814,15 +3814,20 @@
     commandFilename := aCommand asFilename.
     commandFilename isAbsolute ifTrue:[
         "/ something like "/foo/...", tried path is it
-        ^ commandFilename pathName isExecutable
+        commandFilename isExecutable ifFalse:[^ nil].
+        ^ commandFilename pathName
     ].
     commandFilename isExplicitRelative ifTrue:[
         "/ something like "../foo/...", tried path resolved relative to the current directory
-         ^ commandFilename pathName isExecutable
+        commandFilename isExecutable ifFalse:[^ nil].
+         ^ commandFilename pathName
     ].
     (aCommand includes:$/) ifTrue:[
         "/ something like "smalltalk/stx", tried path is relative to the current directory
-        ^ ('./',aCommand) asFilename pathName isExecutable
+        (f := ('./',aCommand) asFilename) isExecutable ifTrue:[
+            ^ f pathName
+        ].    
+        ^ nil
     ].
 
     "/ command is a single word, not relative and not absolute.