From dcef5183f7c2a12f7bd4990bc9a3fe9d27bef55b Mon Sep 17 00:00:00 2001
From: Perttu Ahola <celeron55@gmail.com>
Date: Sun, 25 Mar 2012 23:16:53 +0300
Subject: [PATCH] Small fix to fs::GetDirListing when trying to list an
 inexistent directory

---
 src/filesys.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/filesys.cpp b/src/filesys.cpp
index 805aae6ae..e8a9e88db 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -74,9 +74,8 @@ std::vector<DirListNode> GetDirListing(std::string pathstring)
 
 	if (hFind == INVALID_HANDLE_VALUE) 
 	{
-	  errorstream<<"GetDirListing: Invalid file handle. Error is "
-	  		<<GetLastError()<<std::endl;
-	  retval = (-1);
+		retval = (-1);
+		goto Cleanup;
 	} 
 	else 
 	{
-- 
GitLab