diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-12-12 22:05:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-12-12 22:05:50 +0000 |
commit | 900b4d77f00b3ab7503d5e2865eca61ce5005c69 (patch) | |
tree | a838e8bfddf54ca5c6a2761b554b6ae137213c9b /src/misc1.c | |
parent | 2c7a29c7fd2e51236a00435ed37e280cb98a2131 (diff) |
updated for version 7.0168v7.0168
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c index bef297cf26..cd8acceaaf 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -4443,6 +4443,29 @@ vim_ispathlistsep(c) } #endif +/* + * Return TRUE if the directory of "fname" exists, FALSE otherwise. + * Also returns TRUE if there is no directory name. + * "fname" must be writable!. + */ + int +dir_of_file_exists(fname) + char_u *fname; +{ + char_u *p; + int c; + int retval; + + p = gettail_sep(fname); + if (p == fname) + return TRUE; + c = *p; + *p = NUL; + retval = mch_isdir(fname); + *p = c; + return retval; +} + #if (defined(CASE_INSENSITIVE_FILENAME) && defined(BACKSLASH_IN_FILENAME)) \ || defined(PROTO) /* |