Mail Archives: djgpp-workers/2000/08/25/06:09:29
Eli Zaretskii wrote:
> Looks okay (inspection only), but I wonder whether the recursive
> invocation of basename is such a good idea.
Recursive? I failed to find any recursion there. basename() can be called
max 2 times.
> Imagine an argument such
> as "c:/foo///////////////////////////////////////////////////////".
What would be sane response to this arg? My current code after some,
uhm, resolving would return the same c:/foo/////.../ with one slash less.
In general, is it OK to follow GIGO principle for insane paths? (provided,
that 'garbage-in' part does not cause any crashes, infinite loops etc.)
> Also, what about file names such as /dev/env/FOO or /dev/c/foo? Does
> this code DTRT for them?
Can't imagine why.
> It looks like it depends what does
> __solve_symlinks does for these names.
Yes, except for short ones: /dev/c/ would call __solve_symlinks() for 'dev',
and append 'c'.
> I suggest to add the "/dev/..." names to the test suite.
Will do.
- Raw text -