diff options
author | Pavel Platto <hinidu@gmail.com> | 2014-06-19 23:46:51 +0300 |
---|---|---|
committer | Nicolas Hillegeer <nicolas@hillegeer.com> | 2014-07-14 21:14:40 +0200 |
commit | 29e0cd1571b773feb7fd61118930cdac7d83e38c (patch) | |
tree | 5190da12cc72647b1573c44b55bcc0e030a6be81 /src/nvim/eval.c | |
parent | edd7a8c5ddd99bd0c02b4218d43bccb562809d55 (diff) | |
download | rneovim-29e0cd1571b773feb7fd61118930cdac7d83e38c.tar.gz rneovim-29e0cd1571b773feb7fd61118930cdac7d83e38c.tar.bz2 rneovim-29e0cd1571b773feb7fd61118930cdac7d83e38c.zip |
Refactor vim_tempname
- temp_count is uint32_t now instead of long because it supposed to be
at most 999999999 (comment on line 5227) temporary files. The most
probably it was a long for compatibility with systems where int is
16-bit.
- Use "nvim" as prefix for temp folder name instead of "v"
- Remove unused parameter from vim_tempname
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index eafdd2446c..7dc95bcded 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14030,7 +14030,7 @@ static void f_system(typval_T *argvars, typval_T *rettv) * Write the string to a temp file, to be used for input of the shell * command. */ - if ((infile = vim_tempname('i')) == NULL) { + if ((infile = vim_tempname()) == NULL) { EMSG(_(e_notmp)); goto done; } @@ -14231,22 +14231,8 @@ static void f_taglist(typval_T *argvars, typval_T *rettv) */ static void f_tempname(typval_T *argvars, typval_T *rettv) { - static int x = 'A'; - rettv->v_type = VAR_STRING; - rettv->vval.v_string = vim_tempname(x); - - /* Advance 'x' to use A-Z and 0-9, so that there are at least 34 different - * names. Skip 'I' and 'O', they are used for shell redirection. */ - do { - if (x == 'Z') - x = '0'; - else if (x == '9') - x = 'A'; - else { - ++x; - } - } while (x == 'I' || x == 'O'); + rettv->vval.v_string = vim_tempname(); } /* |