  configure.ac         |   1 +
  lib/Makefile.inc     |   2 +
  lib/curl_config.h.in |   3 +
- lib/pathtools.c      | 556 +++++++++++++++++++++++++++++++++++++++++++
+ lib/pathtools.c      | 562 +++++++++++++++++++++++++++++++++++++++++++
  lib/pathtools.h      |  57 +++++
  lib/url.c            |  26 +-
- 6 files changed, 644 insertions(+), 1 deletion(-)
+ 6 files changed, 650 insertions(+), 1 deletion(-)
  create mode 100644 lib/pathtools.c
  create mode 100644 lib/pathtools.h
 

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

+  char * result = path;
+  char * result_p;
+  char const ** toks;
+  if (path[0] == '/' && path[1] == '/') {
+    /* preserve UNC path */
+    path++;
+    in_size--;
+    result++;
+  }
+  sanitise_path(result);
+  result_p = result;
+
