diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2013-05-04 20:40:01 +0200 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2013-05-04 20:40:01 +0200 |
commit | 4e242569899155fe414950ef0eaf4bbf19e14e3d (patch) | |
tree | 5119f2c796e6e89d797835cd254467eaf2358cb3 /plugingui | |
parent | 52607a944acc7039ce186f07c8894912c8a9b898 (diff) |
to lower case partition name
Diffstat (limited to 'plugingui')
-rw-r--r-- | plugingui/directory.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugingui/directory.cc b/plugingui/directory.cc index 17190e7..9a8fb38 100644 --- a/plugingui/directory.cc +++ b/plugingui/directory.cc @@ -28,6 +28,8 @@ #include <dirent.h> #include <stdio.h> +#include <string> +#include <algorithm> #ifdef WIN32 #include <direct.h> @@ -137,7 +139,7 @@ Directory::EntryList Directory::listFiles(std::string path) { bool Directory::isRoot(std::string path) { #ifdef WIN32 - std::transform(data.begin(), data.end(), data.begin(), ::tolower); + std::transform(path.begin(), path.end(), path.begin(), ::tolower); // TODO: This is not a correct root calculation, but works with partitions if(path.size() == 2) { if(path == root()) return true; @@ -181,8 +183,8 @@ Directory::DriveList Directory::drives() { for(int i = 0; i < 32; i++) { if(d & (1 << i)) { drive_t drive; - char name[] = "X:"; - name[0] = i + 'A'; + char name[] = "x:"; + name[0] = i + 'a'; drive.name = name; drive.number = i; |