Check for a NULL result from realpath; fixes #4113 on non-Windows
authorIan Lynagh <igloo@earth.li>
Sun, 13 Jun 2010 13:42:35 +0000 (13:42 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 13 Jun 2010 13:42:35 +0000 (13:42 +0000)
System/Directory.hs

index 2f3cb25..688a10b 100644 (file)
@@ -685,7 +685,7 @@ canonicalizePath fpath =
 #else
   withCString fpath $ \pInPath ->
   allocaBytes long_path_size $ \pOutPath ->
-    do c_realpath pInPath pOutPath
+    do throwErrnoPathIfNull "canonicalizePath" fpath $ c_realpath pInPath pOutPath
        path <- peekCString pOutPath
 #endif
        return (normalise path)