+
+ /* Just kidding, if the path is "." or "..", then dirname will do
+ * the wrong thing and give us "." as its parent, too. So, we handle
+ * those as special cases.
+ */
+ bool path_is_dots = strcmp(path, ".") == 0 || strcmp(path, "..") == 0;
+ char dots_parent[6] = "../";
+ if (path_is_dots) {
+ parent = strcat(dots_parent, path);
+ }
+