make-w32
[Top][All Lists]
Advanced

[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: Tue, 30 May 2006 22:44:27 +0300

> From: "grischka" <address@hidden>
> Cc: <address@hidden>
> Date: Tue, 30 May 2006 20:07:10 +0200
> 
> Maybe on your way it cant hurt to checkout window's native idea of 
> whats an absolute path: 
> 
> char *abspath(const char *in, char *out)
> {
>   return in && GetFullPathName(in, MAX_PATH, out, NULL) ? out : NULL;
> }
> 
> Looks simplicistic, but works.

I deliberately didn't use a Win32 API call, since the bug report came
from an OS/2 user, where GetFullPathName is unlikely to be available.
It would be quite ironic if, in response to that bug report, we would
provide a solution that didn't work on the OP's system...

Andreas, is there a _getdcwd function on OS/2?

Also, I think we should try not to produce file names with backslashes
in Make's own code, because that fails in subtle ways with some Make
features (e.g., globbing and $wildcard).  So we should at least mirror
the slashes, if we use GetFullPathName.

Incidentally, there's lrealpath in libiberty, and the Windows port of
glibc includes an implementation of realpath.  We could include the
latter somewhere in the w32 subdirectory.

> > ... whereas the user _could_ have wanted the current directory when 
> > the result of $abspath is _used_
> Hm, afaik expansion of relative paths with the "current directory when 
> they are used" is a built-in operating system service, so whoever 
> wants that would not use $abspath in the first place :P

That's true, but the question is what if they do?

Anyway, thanks for describing your views.




reply via email to

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