diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 Changelog for HLint
 
+1.8.59
+    #27, fix up directory file searching
 1.8.58
     Move the API to Language.Haskell.HLint2
     #638, ensure $! doesn't break strictness with strict fields
diff --git a/hlint.cabal b/hlint.cabal
--- a/hlint.cabal
+++ b/hlint.cabal
@@ -1,7 +1,7 @@
 cabal-version:      >= 1.6
 build-type:         Simple
 name:               hlint
-version:            1.8.58
+version:            1.8.59
 license:            BSD3
 license-file:       LICENSE
 category:           Development
diff --git a/src/CmdLine.hs b/src/CmdLine.hs
--- a/src/CmdLine.hs
+++ b/src/CmdLine.hs
@@ -24,6 +24,7 @@
 automatic Cmd{..} = do
     cmdDataDir <- if cmdDataDir == "" then getDataDir else return cmdDataDir
     cmdPath <- return $ if null cmdPath then ["."] else cmdPath
+    cmdExtension <- return $ if null cmdExtension then ["hs", "lhs"] else cmdExtension
     return Cmd{..}
 
 
diff --git a/src/Util.hs b/src/Util.hs
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -29,8 +29,8 @@
 getDirectoryContentsRecursive dir = do
     xs <- getDirectoryContents dir
     (dirs,files) <- partitionM doesDirectoryExist [dir </> x | x <- xs, not $ isBadDir x]
-    rest <- concatMapM getDirectoryContentsRecursive dirs
-    return $ files++rest
+    rest <- concatMapM getDirectoryContentsRecursive $ sort dirs
+    return $ sort files ++ rest
     where
         isBadDir x = "." `isPrefixOf` x || "_" `isPrefixOf` x
 
