summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-19 11:21:14 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-19 14:13:23 +0200
commitab9e44dc966cba2c57cfff25d42ca927a7942faa (patch)
tree6afb08a20c3b49a5bb516af584bee44748884741 /lib/pure
parentecae779956f5e31ec73c33f2e96da8ef61a6c05d (diff)
downloadNim-ab9e44dc966cba2c57cfff25d42ca927a7942faa.tar.gz
better fix for #4497
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/ospaths.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim
index c4058ecce..ebf762048 100644
--- a/lib/pure/ospaths.nim
+++ b/lib/pure/ospaths.nim
@@ -559,9 +559,8 @@ when declared(getEnv) or defined(nimscript):
   when not defined(windows) and declared(os):
     proc checkSymlink(path: string): bool =
       var rawInfo: Stat
-      if lstat(path, rawInfo) < 0'i32:
-        raiseOSError(osLastError())
-      S_ISLNK(rawInfo.st_mode)
+      if lstat(path, rawInfo) < 0'i32: result = false
+      else: result = S_ISLNK(rawInfo.st_mode)
 
   proc findExe*(exe: string, followSymlinks: bool = true): string {.
     tags: [ReadDirEffect, ReadEnvEffect, ReadIOEffect].} =
@@ -584,7 +583,7 @@ when declared(getEnv) or defined(nimscript):
       if existsFile(x):
         when not defined(windows) and declared(os):
           while followSymlinks: # doubles as if here
-            if x.isAbsolute and x.checkSymlink:
+            if x.checkSymlink:
               var r = newString(256)
               var len = readlink(x, r, 256)
               if len < 0: