Let's handle root="" and root="/" safely.
#include "mkdir.h"
#include "parse-util.h"
#include "path-util.h"
+//#include "process-util.h"
#include "stat-util.h"
#include "stdio-util.h"
#include "string-util.h"
* function what to do when encountering a symlink with an absolute path as directory: prefix it by the
* specified path. */
+ if (original_root) {
+ if (isempty(original_root)) /* What's this even supposed to mean? */
+ return -EINVAL;
+
+ if (path_equal(original_root, "/")) /* A root directory of "/" is identical to none */
+ original_root = NULL;
+ }
+
if (original_root) {
r = path_make_absolute_cwd(original_root, &root);
if (r < 0)