Jörn Engel 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.
The path should start with a slash. And if it doesn't, I don't think
any sane person would have a directory name starting with $.
Let's just say we don't support it.
> Correct patch seems hard. In my case tempdirs[i] is defined to
> "$TMPDIR", "/tmp", ".", "$HOME". We don't want to try "$TMPDIR" or
> "$HOME", unless the user explicitly asks us to. We do want to try
> "/tmp" and ".". Add the other platforms and things get even messier.
>
> Maybe the patch below is close enough to correct and simple enough to
> ship? It doesn't allow TMPDIR='$TMPDIR, but retains
> TMPDIR='$SOME_OTHER_DIRECTORY_STARTING_WITH_A_DOLLAR' for those two
> users that might have such a monstrosity.
>
> So many bad options to choose from.
Well, we could make a version of expand_env() that returns an empty
string if the expansion fails. But I don't think it is worth it.
--
hundred-and-one symptoms of being an internet addict:
186. You overstay in the office so you can have more time surfing the net.
/// 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.