Browse Source

Do not list recursively nor return absolute paths

Daniele Bartolini 12 years ago
parent
commit
47b26904a6
2 changed files with 3 additions and 10 deletions
  1. 1 1
      engine/os/OS.h
  2. 2 9
      engine/os/linux/LinuxOS.cpp

+ 1 - 1
engine/os/OS.h

@@ -100,7 +100,7 @@ bool			delete_directory(const char* path);
 /// subdirectories whether @a recursive is true.
 /// @note
 /// Does not follow symbolic links.
-void			list_files(const char* path, bool recursive, Vector<DynamicString>& files);
+void			list_files(const char* path, Vector<DynamicString>& files);
 
 //-----------------------------------------------------------------------------
 // OS ambient variables

+ 2 - 9
engine/os/linux/LinuxOS.cpp

@@ -180,7 +180,7 @@ bool delete_directory(const char* path)
 }
 
 //-----------------------------------------------------------------------------
-void list_files(const char* path, bool recursive, Vector<DynamicString>& files)
+void list_files(const char* path, Vector<DynamicString>& files)
 {
 	DIR *dir;
 	struct dirent *entry;
@@ -199,15 +199,8 @@ void list_files(const char* path, bool recursive, Vector<DynamicString>& files)
 
 		DynamicString filename(default_allocator());
 
-		filename += path;
-		filename += PATH_SEPARATOR;
-		filename += entry->d_name;
+		filename = entry->d_name;
 		files.push_back(filename);
-
-		if (entry->d_type == DT_DIR && recursive)
-		{
-			list_files(filename.c_str(), recursive, files);
-		}
 	}
 
 	closedir(dir);