Revive vim_fname (-> os_file_exists); fix misuse of mch_getperm.

* Move vim_fname from misc1 to os/fs:os_file_exists.
* Add unit tests for os_file_exists.
* Replace misuse of mch_getperm with os_file_exists.
This commit is contained in:
Thomas Wienecke
2014-03-14 22:55:14 +01:00
committed by Thiago de Arruda
parent c83e8b4dc7
commit 1949acc806
14 changed files with 51 additions and 37 deletions

View File

@@ -2310,7 +2310,7 @@ check_overwrite (
|| (buf->b_flags & BF_READERR))
&& !p_wa
&& !bt_nofile(buf)
&& vim_fexists(ffname)) {
&& os_file_exists(ffname)) {
if (!eap->forceit && !eap->append) {
#ifdef UNIX
/* with UNIX it is possible to open a directory */
@@ -2336,7 +2336,6 @@ check_overwrite (
if (other && !emsg_silent) {
char_u *dir;
char_u *p;
int r;
char_u *swapname;
/* We only try the first entry in 'directory', without checking if
@@ -2358,8 +2357,7 @@ check_overwrite (
}
swapname = makeswapname(fname, ffname, curbuf, dir);
vim_free(dir);
r = vim_fexists(swapname);
if (r) {
if (os_file_exists(swapname)) {
if (p_confirm || cmdmod.confirm) {
char_u buff[DIALOG_MSG_SIZE];