From 0d0ad37da1b581197e5c352660105bcc2eb97daf Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 4 Apr 2012 10:50:43 +0000 Subject: StringUtils' GetDirectoryContents() now accepts empty string and interprets it as "current directory" (*nix fix) git-svn-id: http://mc-server.googlecode.com/svn/trunk@450 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/StringUtils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/StringUtils.cpp b/source/StringUtils.cpp index 1e629c25f..46c20b3d8 100644 --- a/source/StringUtils.cpp +++ b/source/StringUtils.cpp @@ -182,9 +182,13 @@ AStringList GetDirectoryContents(const char * a_Directory) DIR * dp; struct dirent *dirp; + if (*a_Directory == 0) + { + a_Directory = "."; + } if ((dp = opendir(a_Directory)) == NULL) { - LOGERROR("Error (%i) opening %s\n", errno, a_Directory ); + LOGERROR("Error (%i) opening directory \"%s\"\n", errno, a_Directory ); } else { -- cgit v1.2.3