comparison src/ex_cmds.c @ 3486:f9a865d97614 v7.3.507

updated for version 7.3.507 Problem: When exiting with unsaved changes, selecting an existing file in the file dialog, there is no dialog to ask whether the existing file should be overwritten. (Felipe G. Nievinski) Solution: Call check_overwrite() before writing. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Wed, 25 Apr 2012 17:32:18 +0200
parents fe7bf24804e1
children ec4ab9d832b0
comparison
equal deleted inserted replaced
3485:0c88089c42de 3486:f9a865d97614
23 static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags)); 23 static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags));
24 static int viminfo_encoding __ARGS((vir_T *virp)); 24 static int viminfo_encoding __ARGS((vir_T *virp));
25 static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing)); 25 static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
26 #endif 26 #endif
27 27
28 static int check_overwrite __ARGS((exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other));
29 static int check_readonly __ARGS((int *forceit, buf_T *buf)); 28 static int check_readonly __ARGS((int *forceit, buf_T *buf));
30 #ifdef FEAT_AUTOCMD 29 #ifdef FEAT_AUTOCMD
31 static void delbuf_msg __ARGS((char_u *name)); 30 static void delbuf_msg __ARGS((char_u *name));
32 #endif 31 #endif
33 static int 32 static int
2720 * Check if it is allowed to overwrite a file. If b_flags has BF_NOTEDITED, 2719 * Check if it is allowed to overwrite a file. If b_flags has BF_NOTEDITED,
2721 * BF_NEW or BF_READERR, check for overwriting current file. 2720 * BF_NEW or BF_READERR, check for overwriting current file.
2722 * May set eap->forceit if a dialog says it's OK to overwrite. 2721 * May set eap->forceit if a dialog says it's OK to overwrite.
2723 * Return OK if it's OK, FAIL if it is not. 2722 * Return OK if it's OK, FAIL if it is not.
2724 */ 2723 */
2725 static int 2724 int
2726 check_overwrite(eap, buf, fname, ffname, other) 2725 check_overwrite(eap, buf, fname, ffname, other)
2727 exarg_T *eap; 2726 exarg_T *eap;
2728 buf_T *buf; 2727 buf_T *buf;
2729 char_u *fname; /* file name to be used (can differ from 2728 char_u *fname; /* file name to be used (can differ from
2730 buf->ffname) */ 2729 buf->ffname) */