[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in builtin function abspath

From: Eli Zaretskii
Subject: Re: Bug in builtin function abspath
Date: Sun, 28 May 2006 23:44:33 +0300

> Date: Sun, 28 May 2006 10:57:33 +0200
> From: Alessandro Vesely <address@hidden>
> Eli Zaretskii wrote:
> >>>
> >>>  . It handles the d:foo case by converting it to d:./foo
> >> Just a short comment: the abspath description says that it returns
> >> "an absolute name that does not contain any `.' or `..' components".
> > 
> > That's true, but we cannot do any better in this case.
> Why shouldn't we use _getdcwd() to get the default path?

Because there's no way of knowing whether that is what the user meant.
_getdcwd will fetch the current directory _at_the_moment_
_of_the_call_, whereas the user _could_ have wanted the current
directory when the result of $abspath is _used_, which could be an
entirely different place, since it is not uncommon for a Makefile to
chdir a lot.  The patch I suggested leaves the semantics in the user's
hands: they get what they wrote.

Producing d:./foo is almost the same as leaving it alone as d:foo,
except that it has the slight advantage of inserting the slash, which
avoids possible subtle complications further down the line.  For
example, `$(dir d:foo)' yields `d:', so if one is careless and adds
`/bar' to that, they get d:/bar, which is quite different from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]