aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libLumina/LuminaOS-OpenBSD.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp
index 44917a6e..2c86995a 100644
--- a/libLumina/LuminaOS-OpenBSD.cpp
+++ b/libLumina/LuminaOS-OpenBSD.cpp
@@ -30,9 +30,8 @@ QStringList LOS::ExternalDevicePaths(){
QStringList devs = LUtils::getCmdOutput("mount");
//Now check the output
for(int i=0; i<devs.length(); i++){
- if(devs[i].startsWith("/dev/")){
QString type = devs[i].section(" ",0,0);
- type.remove("/dev/");
+ type.remove("/dev/");
//Determine the type of hardware device based on the dev node
if(type.startsWith("sd")||type.startsWith("wd")){ type = "HDRIVE"; }
else if(type.startsWith("cd")){ type="DVD"; }
@@ -40,12 +39,13 @@ QStringList LOS::ExternalDevicePaths(){
//Now put the device in the proper output format
QString fs = devs[i].section(" ", 4, 4);
QString path = devs[i].section(" ",2, 2);
- devs[i] = type+"::::"+fs+"::::"+path;
- }else{
- //invalid device - remove it from the list
- devs.removeAt(i);
- i--;
- }
+ if (!fs.isEmpty() ) { //we not found a filesystem, most probably this is an invalid row
+ devs[i] = type+"::::"+fs+"::::"+path;
+ }
+ else {
+ devs.removeAt(i);
+ i--;
+ }
}
return devs;
}
bgstack15