Mercurial > mplayer.hg
changeset 32644:a6431ff5481f
Add mp_path_is_absolute function.
author | cboesch |
---|---|
date | Fri, 24 Dec 2010 23:09:08 +0000 |
parents | d68c55785751 |
children | 715c9997201e |
files | path.c path.h |
diffstat | 2 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/path.c Fri Dec 24 23:05:49 2010 +0000 +++ b/path.c Fri Dec 24 23:09:08 2010 +0000 @@ -233,3 +233,15 @@ dirname[len] = '\0'; return dirname; } + +/** + * @brief Indicates weither the path is absolute or not. + */ +int mp_path_is_absolute(const char *path) +{ +#if HAVE_DOS_PATHS + return path[0] && path[1] == ':'; +#else + return path[0] == '/'; +#endif +}