Sigh.
`PATH_MAX` is not our only problem here. `PATH_MAX` is actually 260, in case 
this wasn't known already before. In `src/win32.c` we also use the constant 
`MAX_PATH` which seems to be 260 as well.

But even with more than 260 (tried to trick 1024 into `get_path_max()`) doesn't 
help as it seems the `realpath()` in `src/tagmanager/tm_sourcefile.c` is broken 
for such paths. Maybe because we use `GetFullPathNameA()` here and do not pass 
properly encoded filenames. But this is just a guess.
What I know so far after a little debugging is that `realpath()` returns an 
empty string for such filenames and those empty strings are compared with each 
other, hence only the first such file is opened because at the second file 
Geany things the file with the realpath `""` is already opened.

The comment on the `realpath()` function states it was just taken from a bug 
report. And the comment sounds a bit like as if I wrote it years ago :). Maybe 
nowadays there are better, more reliable ways to get a unique filename on 
Windows?

I won't debug this issue further for now as preparing the release is more 
important and fixing this issue takes probably more time than we have before 
the release.
Anyway, any ideas are welcome!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1534#issuecomment-314531324

Reply via email to