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: Andreas Büning
Subject: Re: Bug in builtin function abspath
Date: Fri, 26 May 2006 23:39:33 +0200

Eli Zaretskii schrieb:
> 
> > Date: Fri, 26 May 2006 21:52:05 +0200
> > From: Andreas =?iso-8859-1?Q?B=FCning?= <address@hidden>
> > Cc:
> >
> > make 3.81 has a new builtin function 'abspath' which doesn't support
> > drive letters.
> 
> Could you please provide examples of this non-support?  At least the
> simple example below works for me:

[snip]

> (Yes, I see in the source code that it will not DTRT with "d:/foo" and
> will not add a drive letter to "/foo", but I wonder whether there are
> other examples.)

Exactly. But these are real examples which can happen if some Makefile
uses commands like pwd or some other make builtins. In the first case
you will get something like "c:/bar/d:/foo/file.c" which can't work,
obviously.


> > I'm using OS/2, not Windows, so if any code is added to the w32
> > subdirectory it won't solve the problem for me.
> 
> Is that the EMX port?  If not, please describe how you build Make
> (i.e. what OS-dependent #define's are used).

Yes. Just ./configure && make. I used HAVE_DOS_PATHS because that
define will be most likely common to all systems having drive letters,
I guess.


> > --- old/make-3.81/function.c  Sat Apr  1 08:36:40 2006
> > +++ gnu/make-3.81/function.c  Fri May 26 20:38:16 2006
> 
> This patch is extremely complex.  Why isn't it sufficient to modify
> the simple-minded test here:

[...]

> and make sure each test for '/' uses IS_PATHSEP instead of a literal
> comparison to '/'?  I don't see any need to ``hide'' the drive letter
> from the code, but perhaps there are examples where this is needed?

It's hard to remember exactly why I did what 10 months ago but I think
I did it because there were too many cases:
c:/dir, c:\dir, c:/dir/, c:\dir\, c:dir, \dir.
It simplified the algorithm when I hid the drive letter (there are
some cases in the code where the 1st or the last character is tested
for '/' which can become really difficult if there is a leading drive
letter).

And, it seems I forgot the IS_PATHSEP in line 2009:

  /* Unless it is root strip trailing separator.  */
  if (dest > apath + 1 && dest[-1] == '/')
    --dest;


Regards,
Andreas Büning




reply via email to

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