  
 diff --git a/lib/pathtools.c b/lib/pathtools.c
 new file mode 100644
-index 000000000..c09458e95
+index 000000000..53d0db00b
 --- /dev/null
 +++ b/lib/pathtools.c
-@@ -0,0 +1,556 @@
+@@ -0,0 +1,562 @@
 +/*
 +      .Some useful path tools.
 +        .ASCII only for now.

+  char * result = path;
+  char * result_p;
+  char const ** toks;
+  sanitise_path(result);
+  result_p = result;
+

+    *path_p = '/';
+  }
+  /* Replace any '//' with '/' */
+  path_p = path + !!*path; /* skip first character, if any, to handle UNC paths correctly */
+  while ((path_p = strstr (path_p, "//")) != NULL)
+  {
+    memmove (path_p, path_p + 1, path_size--);
