summaryrefslogtreecommitdiff
path: root/plugingui/directory.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2013-05-04 20:40:01 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2013-05-04 20:40:01 +0200
commit4e242569899155fe414950ef0eaf4bbf19e14e3d (patch)
tree5119f2c796e6e89d797835cd254467eaf2358cb3 /plugingui/directory.cc
parent52607a944acc7039ce186f07c8894912c8a9b898 (diff)
to lower case partition name
Diffstat (limited to 'plugingui/directory.cc')
-rw-r--r--plugingui/directory.cc8
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;