-/* Duplicate a path, with backslashes translated into forward slashes; return
- * empty string for NULL input; also strip leading and trailing slashes. */
+/*
+ * canonicalize_wim_path() - Given a user-provided path to a file within a WIM
+ * image, translate it into a "canonical" path.
+ *
+ * - Translate both types of slash into a consistent type (WIM_PATH_SEPARATOR).
+ * - Collapse path separators.
+ * - Add leading slash if missing.
+ * - Strip trailing slashes.
+ *
+ * Examples (with WIM_PATH_SEPARATOR == '/'):
+ *
+ * => / [ either NULL or empty string ]
+ * / => /
+ * \ => /
+ * hello => /hello
+ * \hello => /hello
+ * \hello => /hello
+ * /hello/ => /hello
+ * \hello/ => /hello
+ * /hello//1 => /hello/1
+ * \\hello\\1\\ => /hello/1
+ */