Move after_pathsep from misc2.c

This commit is contained in:
John Schmidt
2014-03-31 00:39:11 +02:00
committed by Thiago de Arruda
parent 2cb026c65c
commit e29e956348
4 changed files with 12 additions and 12 deletions

View File

@@ -1613,17 +1613,6 @@ int get_real_state(void)
return State; return State;
} }
/*
* Return TRUE if "p" points to just after a path separator.
* Takes care of multi-byte characters.
* "b" must point to the start of the file name
*/
int after_pathsep(char_u *b, char_u *p)
{
return p > b && vim_ispathsep(p[-1])
&& (!has_mbyte || (*mb_head_off)(b, p - 1) == 0);
}
/* /*
* Return TRUE if file names "f1" and "f2" are in the same directory. * Return TRUE if file names "f1" and "f2" are in the same directory.
* "f1" may be a short name, "f2" must be a full path. * "f1" may be a short name, "f2" must be a full path.

View File

@@ -68,7 +68,6 @@ void set_fileformat(int t, int opt_flags);
int default_fileformat(void); int default_fileformat(void);
int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg); int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg);
int get_real_state(void); int get_real_state(void);
int after_pathsep(char_u *b, char_u *p);
int same_directory(char_u *f1, char_u *f2); int same_directory(char_u *f1, char_u *f2);
int vim_chdirfile(char_u *fname); int vim_chdirfile(char_u *fname);
int illegal_slash(char *name); int illegal_slash(char *name);

View File

@@ -1662,3 +1662,14 @@ char_u *fix_fname(char_u *fname)
#endif #endif
} }
/*
* Return TRUE if "p" points to just after a path separator.
* Takes care of multi-byte characters.
* "b" must point to the start of the file name
*/
int after_pathsep(char_u *b, char_u *p)
{
return p > b && vim_ispathsep(p[-1])
&& (!has_mbyte || (*mb_head_off)(b, p - 1) == 0);
}

View File

@@ -31,4 +31,5 @@ int path_with_url(char_u *fname);
int vim_isAbsName(char_u *name); int vim_isAbsName(char_u *name);
int vim_FullName(char_u *fname, char_u *buf, int len, int force); int vim_FullName(char_u *fname, char_u *buf, int len, int force);
char_u *fix_fname(char_u *fname); char_u *fix_fname(char_u *fname);
int after_pathsep(char_u *b, char_u *p);
#endif #endif