This is the mail archive of the
mailing list for the GDB project.
Re: Better realpath
> From: Vladimir Prus <email@example.com>
> Date: Sat, 14 Jun 2008 16:14:07 +0400
> Cc: firstname.lastname@example.org
> Speaking of the issues you've raised in:
> I think that:
> 1. The order of slashes is a cosmetic issue.
> 2. The case of filenames is also a cosmetic issues.
Would it surprise you that I disagree?
Fixing those is not a big deal, so how about making gdb_realpath
correct both cosmetically and behavior-wise?
> 3. The matter of filename existance is a behaviour issue, and I think
> I can modify gdb_realpath to perform a check explicitly. OTOH, it's not
> clear if any code actually expects file existane check to be performed.
I don't think it matters whether the callers expect it or not. As
long as we use realpath, which always checks the result for existence,
we should do the same in the other branches, so that the resulting GDB
function behaves consistently. Alternatively, we could refrain from
using realpath, in which case we should consistently _not_ require
that the file exists.