[PATCH 0/8] Fix broken file paths on Win32
dirk at hohndel.org
Wed Dec 18 21:59:12 UTC 2013
I tried to pick the last for every patch number... but the resulting
tree doesn't compile for me. Some subsurface_zip_close have one arg,
some have two. linux.c calls zip_open without including zip.h.
So my guess is that this is messed up somewhere.
Lubomir, can you create a clean series against master, please?
On Thu, 2013-12-19 at 00:46 +0200, Lubomir I. Ivanov wrote:
> these changes were discussed previously about the broken
> support for paths with special characters on win32.
> this proves again that Windows is bad about the UTF-16 choices
> they've made and not very portable in the long run for M/P software.
> the provided solution is in C and in the backend.
> the Qt/QFile alternative of re-writeing file.c could be
> much cleaner, but i don't really see how that will happen
> without re-writing other parts to use QFile as well and merging the
> frontend and backend a bit more.
> also zip_open() is still an issue, because their API
> is partial:
> 1) no way to read buffers
> 2) no way to read a wchar_t path
> some notes:
> - the changes in uemis-downloader.c are untested .
> - the sqlite3 wrapper is untested (i don't think i have such
> files to test with either way) .
> -  the zip_open() wrapper is based on zip_fdopen()
> regarding  and the webservices code:
> if an user has decided to install windows in a strange path
> such as the test thiago gave e.g. C:\?G??\temp instead of c:\widnows\temp,
> then possibly this will brake not only subsurface but other software
> as well.
> following this logic, we don't need to change the zip_open()
> calls in the webservices when uploading to divelogs.de to be the
> wrapped version and also possibly the same when downloading.
> but one pitfall of the zip_open() wrapper logic is that we can no longer
> create a zipfile in a weird path, because the wrapper with _fdopen makes
> it read-only. so ZIP_CREATE should be used on a file in a temp/safe path
> and the same file should be copyed into the target path and the original
> browsing trough the code we don't actually preserve the ZIP
> format of files such as DLD, which is a bit odd, but if we decide
> to write and create zip files then a zip_create() method will be needed
> that solves the described above issue.
> [PATCH 1/8] Files: use UTF-8 names when opening and importing
> [PATCH 2/8] Files: add wrappers for open(), fopen(), sqlite3_open()
> [PATCH 3/8] Maintab: fix a warning about missing parentheses
> [PATCH 4/8] Files: add a wrapper for opendir()
> [PATCH 5/8] Files: use the wrappers for fopen() and open()
> [PATCH 6/8] Files: some win32 changes in uemis-downloader.c
> [PATCH 7/8] Webservices: use toUtf8() when dealing with files
> [PATCH 8/8] Files: add a wrapper for zip_open() on Win32
> subsurface mailing list
> subsurface at hohndel.org
More information about the subsurface