[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim-dev
Subject:    Re: mch_FullName() problem with bcc32 / msdev
From:       Bram Moolenaar <Bram () moolenaar ! net>
Date:       2000-08-25 9:51:07
[Download RAW message or body]


Michael Geddes wrote:

> I have found the inconsistency that is causing cd .. to fail in a bcc32
> (5.5) version of vim.exe.
> 
> The crucial factor is in the call to mch_FullName() with fname == "" .
> 
> In MSVC,  _fullpath( buf, "", len-1)   returns 0 with  the current directory
> in 'buf'.. causing the current directory to be returned along with OK
> result.

That's what the Unix version does too.

> In bcc32(5.5) _fullpath( buf, "", len-1) returns an error causing a FAIL
> return for mch_FullName with "" in buf.

That's not what I would expect.

> The next factor is that  mch_isFullName does not check for ERROR returned by
> mch_FullName... 
> and so reports "" as a FullName, since strcoll("","" ) would equal 0.

When mch_FullName() fails it should return the not expanded name.
The test would always return TRUE then, thus that's wrong.  I would say that
when a name can't be made into an absolute path, it probably isn't absolute.

> If somebody (Bram?) could tell me what  mch_FullName SHOULD return in this
> case, I'll try fixing it.

I think that mch_FullName("") should return the current directory.  At least
then it's consistent with the Unix version.

-- 
It is illegal for a driver to be blindfolded while operating a vehicle.
		[real standing law in Alabama, United States of America]

///  Bram Moolenaar     Bram@moolenaar.net     http://www.moolenaar.net  \\\
\\\  Vim: http://www.vim.org      ICCF Holland: http://iccf-holland.org  ///

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic