James McCoy wrote:

> > > This just uses the existing logic in mch_can_exe to populate a buffer 
> > > with the
> > > absolute path to the binary.  The Windows code was already walking
> > > $PATH, so it seems pointless not to actually use the information.
> > 
> > Quite a few years ago I was debugging a Vim that started up slowly.  It
> > turned out that walking through $PATH was the main cause for that.  So I
> > don't want to walk through $PATH when not really needed.
> 
> Then it would be better to use platform-specific functionality to get
> the absolute path of the running binary instead of trying to re-use
> functionality that's intended for a different purpose.

What platform-specific functionality is there?  Perhaps Linux has a way
to get the actual path, instead of using argv[0]?

> > > There's no reason not to behave the same way on non-Windows platforms,
> > > so change the code to always use mch_can_exe.  With a small fix to how
> > > mch_can_exe determines whether FullName_save is needed.
> > 
> > I'll merge your change with the fix for Windows.
> 
> Except my changes weren't merged.  If you have questions about why I did
> something, please ask instead of changing it, so that I can explain
> before you merge it.  That makes it easier for both of us.

Well, your change didn't look right.  I thought mine did.  So what's
better in yours?

Anyway, I made a mistake that needs to be fixed.  And I now realize that
for MS-Windows ".exe" is only added when the path is not absolute,
that's inconsistent, should always add the extension.

-- 
"I simultaneously try to keep my head in the clouds and my feet on the
ground.  Sometimes it's a stretch, though."              -- Larry Wall

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui