On Friday, March 14, 2014 2:04:26 AM UTC+4, Viktor Kojouharov wrote:
> It contains the full path which was used to start vim. It could very well be
> a relative path, or be the same as progname, if vim was run started from the
> $PATH, but wouldn't the value be enough to start another instance of vim?
It is not true. If vim was launched with one of exec* family of functions (most
common scenario) it contains nothing more then argv0: either first value in
argv array (execv*) or just first argument after path (execl*). I.e. try the
following programm:
#include <unistd.h>
int main(int argc, char **argv)
{
return execl("/usr/bin/vim", "/bin/sh", (char *) NULL);
}
. This will run vim, with argv[0] set to /bin/sh.
The only reason why you are thinking that it contains full or relative path is
that it is uncommon and unreasonable to use values other then these for vim.
For shells $0 set to -*sh is a common variant to identify login shells, even
though there is no `-zsh` executable.
--
--
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.