On Mon, Feb 20, 2017 at 6:49 AM, Jérémie Guichard <[email protected]> wrote:
>
> I narrowed it!
Good job.
> As a proof of concept I added an ugly: "extern int p_stat(const char* path,
> struct stat* buf);" on top of git-access.c and used it in get_remote_repo
> and is_git_repository (these are the 2 only places stat function is used in
> the whole project). It fixed my issue (I could Open and Save could
> storage)...
Ugh. Ok. So it appears that whatever Windows posix emulation library
we use is pretty broken. Looking at the "p_stat()" implementation in
libgit2, it just does a utf8->wchar expansion.
We actually do the same thing in "subsurface_open()", for all the same
reasons. I wonder why the system "stat()" routine can't just get that
right? What the hell is wrong with Windows libraries? Why doesn't the
windows "stat()" routine just DTRT?
> 3. Implement our own portable stat
I think this is the right thing to do, we already end up having all
the pieces, and we already use "fstat()" even on windows, so we could
just do a subsurface_stat() exactly like we do subsurface_open().
Linus
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface