From ae048f7ac4a9ab6576ca6842aa13e5c9c31e35a7 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 9 Feb 2024 15:59:37 +0100 Subject: Add utility function to fixup Windows file paths The idea is to iterate over a (canonicalized) path with forward slashes by components, i.e. file and directory names. Each name is then looked at by iterating over components, i.e. everything between dots. If a component is an illegal name, like COM1 or AUX, we add an underscore. If it contains illegal characters, like : or \, we re-map that character into unicode private use area. Signed-off-by: David Oberhollenzer --- include/util/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/util/util.h b/include/util/util.h index db6a712..0c632de 100644 --- a/include/util/util.h +++ b/include/util/util.h @@ -79,4 +79,6 @@ SQFS_INTERNAL int hex_decode(const char *in, size_t in_sz, SQFS_INTERNAL int base64_decode(const char *in, size_t in_len, sqfs_u8 *out, size_t *out_len); +SQFS_INTERNAL char *fix_win32_filename(const char *path); + #endif /* SQFS_UTIL_H */ -- cgit v1.2.3