[Scummvm-devel] SearchMan contains each file in the current directory twice
drmccoy at users.sourceforge.net
Sun Jan 31 12:45:14 CET 2010
On 2010-01-31 12:08:23 +0100, Max Horn wrote:
> It doesn't attempt to check whether e.g. "current dir" == "/some/other/
> path", and how could it, as deciding this is highly non-portable and
> not that easy to start with either. (Let's not forget about comparing
> things like "/some/path" and "/some/indirect/../path", which point to
> the same dir, too;
Hmm, I had thought about using realpath(), but look looking at its
manpage now, I see that it's just conforming to 4.4BSD and
POSIX.1-2001. I guess there a most probably no existing
implementations on quite a number of our target platforms.
> or on Linux, there could be hard links and sym
Ah, reading just now that MacOS X does allow hardlinks to directories.
Didn't know that, Linux does not.
Symlinks at least are resolved by realpath(), FWIW.
> This adds a lot of complexity to the code, only to catch a border
> case, which most likely only a few devs ever hit... Personally, I am
> not convinced that it would be worth it.
Yeah, you're probably right there.
I had thought it would just be a quick change, simply throwing the
paths are realpath() or that the paths would even be already stored in
a comparable manner.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: Digital signature
More information about the Scummvm-devel