From ffff0c112f891dabc7399e1fdfe0f53135996157 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Thu, 30 Apr 1998 19:51:07 +0000
Subject: [PATCH] [project @ 1998-04-30 19:51:07 by sof] tidyup

---
 ghc/lib/std/Directory.lhs | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ghc/lib/std/Directory.lhs b/ghc/lib/std/Directory.lhs
index 778ecad661a6..edd0e7ba3ab5 100644
--- a/ghc/lib/std/Directory.lhs
+++ b/ghc/lib/std/Directory.lhs
@@ -337,15 +337,14 @@ The path refers to an existing non-directory object.
 --getDirectoryContents :: FilePath -> IO [FilePath]
 getDirectoryContents path = do
     dir <- _ccall_ openDir__ path
-    ptr <- _ccall_ malloc (``sizeof(struct dirent**)''::Int)
     if dir == ``NULL'' 
 	then constructErrorAndFail "getDirectoryContents"
-     	else loop dir ptr
+     	else loop dir
   where
-    loop :: Addr -> Addr -> IO [String]
-    loop dir dirent_ptr = do
+    loop :: Addr -> IO [String]
+    loop dir  = do
       dirent_ptr <- _ccall_ readDir__ dir
-      if dirent_ptr == ``NULL'' 
+      if (dirent_ptr::Addr) == ``NULL'' 
        then do
 	  return [] 
        else do
@@ -355,7 +354,7 @@ getDirectoryContents path = do
 	    -- calls to readdir() may overwrite it.
           len     <- _ccall_ strlen str
 	  entry   <- stToIO (unpackNBytesST str len)
-	  entries <- loop dir dirent_ptr
+	  entries <- loop dir
           return (entry:entries)
 \end{code}
 
-- 
GitLab