(vfs_path_as_string): clarify return value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
c45e109515
Коммит
32bc72a1d7
@ -134,15 +134,13 @@ vfs_path_get_last_path_vfs (const vfs_path_t * vpath)
|
||||
*
|
||||
* @param vpath pointer to vfs_path_t object
|
||||
*
|
||||
* @return pointer to newly created string.
|
||||
* @return pointer to constant string
|
||||
*/
|
||||
|
||||
static inline char *
|
||||
static inline const char *
|
||||
vfs_path_as_str (const vfs_path_t * vpath)
|
||||
{
|
||||
if (vpath == NULL)
|
||||
return NULL;
|
||||
return vpath->str;
|
||||
return (vpath == NULL ? NULL : vpath->str);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -72,7 +72,7 @@ get_absolute_name (const vfs_path_t * vpath)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
my_mkdir_rec (char *s, mode_t mode)
|
||||
my_mkdir_rec (const char *s, mode_t mode)
|
||||
{
|
||||
char *p, *q;
|
||||
int result;
|
||||
@ -91,12 +91,10 @@ my_mkdir_rec (char *s, mode_t mode)
|
||||
}
|
||||
|
||||
/* FIXME: should check instead if s is at the root of that filesystem */
|
||||
if (!vfs_file_is_local (s_vpath))
|
||||
{
|
||||
if (!vfs_file_is_local (s_vpath))
|
||||
{
|
||||
vfs_path_free (s_vpath);
|
||||
return -1;
|
||||
}
|
||||
vfs_path_free (s_vpath);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!strcmp (s, PATH_SEP_STR))
|
||||
|
@ -100,8 +100,7 @@ static size_t
|
||||
str_common (const vfs_path_t * s1_vpath, const vfs_path_t * s2_vpath)
|
||||
{
|
||||
size_t result = 0;
|
||||
char *s1;
|
||||
char *s2;
|
||||
const char *s1, *s2;
|
||||
|
||||
s1 = vfs_path_as_str (s1_vpath);
|
||||
s2 = vfs_path_as_str (s2_vpath);
|
||||
@ -139,8 +138,7 @@ static int
|
||||
pathcmp (const vfs_path_t * p1_vpath, const vfs_path_t * p2_vpath)
|
||||
{
|
||||
int ret_val;
|
||||
char *p1;
|
||||
char *p2;
|
||||
const char *p1, *p2;
|
||||
|
||||
p1 = vfs_path_as_str (p1_vpath);
|
||||
p2 = vfs_path_as_str (p2_vpath);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user