Mercurial > vim
diff src/misc1.c @ 594:35cef95a6b76 v7.0168
updated for version 7.0168
author | vimboss |
---|---|
date | Mon, 12 Dec 2005 22:05:50 +0000 |
parents | 3686831cf3da |
children | cd3689efd90a |
line wrap: on
line diff
--- 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) /*