Merge pathToAbsoluteSchemaString and pathToSchemaString

These functions did almost the same thing, the only difference was that
the former inserted module prefixes everyhwere and the other didn't.
The new function takes an argument specifying whether to insert prefixes
everyhwere.

pathToSchemaString also checks whether a path is absolute or relative
and prepends a slash. This means, that it's no longer possible to
convert and absolute path to a string with no leading slash. The
StaticSchema class had to be changed accordingly, because it stored
absolute paths in strings without a leading slash (because it was
designed before absolute paths existed).

The fact that this was split into two functions helped find an error in
a later patch.

Change-Id: I6112cb5982919b51b61152f355771a52dd467c6e
diff --git a/src/utils.cpp b/src/utils.cpp
index eb4f432..cd0858f 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -21,10 +21,13 @@
 {
     std::string res = path;
     auto pos = res.find_last_of('/');
-    if (pos == res.npos)
+    if (pos == res.npos) { // path has no backslash - it's either empty, or is a relative path with one fragment
         res.clear();
-    else
+    } else if (pos == 0) { // path has one backslash at the start - it's either "/" or "/one-path-fragment"
+        return "/";
+    } else {
         res.erase(pos);
+    }
     return res;
 }