summaryrefslogtreecommitdiff
path: root/lib/util/fix_win32_filename.c
AgeCommit message (Collapse)Author
2024-02-14Fix win32 filename sanitation for cases were we have clashesDavid Oberhollenzer
We fix filenames containing components like COM1 or PRN by appending an underscore ('_'). A squashfs archive may contain files that already have such a modifed name (e.g. COM1_) which would now potentially clash. This is fixed by matching any number of trailing '_' characters for the bad name and adding another one. So all existing names that start with an illegal prefix and have any number of underscores, will always have an additional one appended. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2024-02-09Add utility function to fixup Windows file pathsDavid Oberhollenzer
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 <david.oberhollenzer@sigma-star.at>