diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-04-26 01:13:10 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-02 15:58:33 -0300 |
commit | 8500eeed86f1cc19f7d038031436a09f80cc6ce9 (patch) | |
tree | f194e3f22583d03f4ca291bbf78e8c2b92316bcf | |
parent | cb5acb705aadb1bf3d240c1d3ad296bfc07789c8 (diff) | |
download | rneovim-8500eeed86f1cc19f7d038031436a09f80cc6ce9.tar.gz rneovim-8500eeed86f1cc19f7d038031436a09f80cc6ce9.tar.bz2 rneovim-8500eeed86f1cc19f7d038031436a09f80cc6ce9.zip |
Don't retry to make the tempname in write_viminfo() with shortname=1
ref #572
-rw-r--r-- | src/ex_cmds.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 8664a3c6d0..c65ff6dbbf 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1569,44 +1569,14 @@ void write_viminfo(char_u *file, int forceit) } #endif - /* - * Make tempname. - * May try twice: Once normal and once with shortname set, just in - * case somebody puts his viminfo file in an 8.3 filesystem. - */ - for (;; ) { - tempname = buf_modname( -#ifdef UNIX - shortname, -#else - FALSE, -#endif - fname, - (char_u *)".tmp", - FALSE); - if (tempname == NULL) /* out of memory */ - break; - + // Make tempname + tempname = buf_modname(FALSE, fname, (char_u *)".tmp", FALSE); + if (tempname != NULL) { /* * Check if tempfile already exists. Never overwrite an * existing file! */ if (mch_stat((char *)tempname, &st_new) == 0) { -#ifdef UNIX - /* - * Check if tempfile is same as original file. May happen - * when modname() gave the same file back. E.g. silly - * link, or file name-length reached. Try again with - * shortname set. - */ - if (!shortname && st_new.st_dev == st_old.st_dev - && st_new.st_ino == st_old.st_ino) { - vim_free(tempname); - tempname = NULL; - shortname = TRUE; - continue; - } -#endif /* * Try another name. Change one character, just before * the extension. This should also work for an 8.3 @@ -1629,7 +1599,6 @@ void write_viminfo(char_u *file, int forceit) } } } - break; } if (tempname != NULL) { |