On Thu, Dec 03, 2015 at 11:03:19AM -0800, Jörn Engel wrote:
> On Thu, Dec 03, 2015 at 05:43:33PM +0100, Bram Moolenaar wrote:
> >
> > Does this patch fix your problem:
> >
> >
> > --- a/fileio.c 2015-12-03 13:52:48.451584080 +0100
> > +++ b/fileio.c 2015-12-03 17:31:53.457770134 +0100
> > @@ -7390,8 +7390,9 @@
> >
> > /* expand $TMP, leave room for "/v1100000/999999999" */
> > expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
> > - if (mch_isdir(itmp)) /* directory exists */
> > + if (itemp[0] != '$' && mch_isdir(itmp))
> > {
> > + /* directory exists */
> > # ifdef __EMX__
> > /* If $TMP contains a forward slash (perhaps using bash or
> > * tcsh), don't add a backslash, use a forward slash!
>
> Doesn't compile, s/itemp/itmp/ fixes that. Next I cannot seem to
> reproduce the problem with or without the patch. My self-compiled vim
> behaves completely different from the distro-supplied vim. Looks like a
> day or so to track down the differences, which I don't have.
>
> But fundamentally this patch is still wrong. If I run
> export TMPDIR='$TMPDIR' vim
> then vim should very much try '$TMPDIR' because I explicitly asked it
> to do so. Might be a silly choice, but that is mine to make.
I've always found it rather awkward that Vim tries to be too intelligent
about things that look like environment variables. The behavior should
be consistent.
If $FOO is used in a context where environment variables are expanded,
but that environment variable doesn't exist in the environment, then it
should result in an empty string. The current behavior, although
documented, is just inconsistent and therefore error-prone.
When $FOO exists, its value is substituted, otherwise the literal $FOO
is used. If one wants to literally use $FOO, then the $ should be
escaped.
Cheers,
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>
--
--
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.