Mercurial > vim
comparison src/ex_cmds.c @ 6721:7347229a646a v7.4.684
updated for version 7.4.684
Problem: When starting several Vim instances in diff mode, the temp files
used may not be unique. (Issue 353)
Solution: Add an argument to vim_tempname() to keep the file.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 31 Mar 2015 13:33:08 +0200 |
parents | d879db7c2f56 |
children | b85fcd9b858d |
comparison
equal
deleted
inserted
replaced
6720:1f42458bf2e7 | 6721:7347229a646a |
---|---|
1156 curbuf->b_op_end.lnum = line2; | 1156 curbuf->b_op_end.lnum = line2; |
1157 curwin->w_cursor.lnum = line2; | 1157 curwin->w_cursor.lnum = line2; |
1158 } | 1158 } |
1159 else | 1159 else |
1160 #endif | 1160 #endif |
1161 if ((do_in && (itmp = vim_tempname('i')) == NULL) | 1161 if ((do_in && (itmp = vim_tempname('i', FALSE)) == NULL) |
1162 || (do_out && (otmp = vim_tempname('o')) == NULL)) | 1162 || (do_out && (otmp = vim_tempname('o', FALSE)) == NULL)) |
1163 { | 1163 { |
1164 EMSG(_(e_notmp)); | 1164 EMSG(_(e_notmp)); |
1165 goto filterend; | 1165 goto filterend; |
1166 } | 1166 } |
1167 | 1167 |
1961 * "normal" temp file. | 1961 * "normal" temp file. |
1962 */ | 1962 */ |
1963 if (fp_out == NULL) | 1963 if (fp_out == NULL) |
1964 { | 1964 { |
1965 vim_free(tempname); | 1965 vim_free(tempname); |
1966 if ((tempname = vim_tempname('o')) != NULL) | 1966 if ((tempname = vim_tempname('o', TRUE)) != NULL) |
1967 fp_out = mch_fopen((char *)tempname, WRITEBIN); | 1967 fp_out = mch_fopen((char *)tempname, WRITEBIN); |
1968 } | 1968 } |
1969 | 1969 |
1970 #if defined(UNIX) && defined(HAVE_FCHOWN) | 1970 #if defined(UNIX) && defined(HAVE_FCHOWN) |
1971 /* | 1971 /* |