mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
182:a56a73fd2a6f
Parent:
167:e84263d55307
Child:
187:0387e8f68319
--- a/platform/FilePath.cpp	Fri Feb 16 16:09:33 2018 +0000
+++ b/platform/FilePath.cpp	Tue Mar 20 16:56:18 2018 +0000
@@ -18,9 +18,10 @@
 namespace mbed {
 
 FilePath::FilePath(const char* file_path) : file_name(NULL), fb(NULL) {
-    if ((file_path[0] != '/') || (file_path[1] == 0)) return;
+    // skip slashes
+    file_path += strspn(file_path, "/");
 
-    const char* file_system = &file_path[1];
+    const char* file_system = file_path;
     file_name = file_system;
     int len = 0;
     while (true) {
@@ -36,6 +37,7 @@
         file_name++;
     }
 
+    MBED_ASSERT(len != 0);
     fb = FileBase::lookup(file_system, len);
 }