forked from enlightenment/efl
Add vim header.
Bail early on error. Strip all trailing slashes. SVN revision: 26049
This commit is contained in:
parent
0401c102c1
commit
9702e0ba8e
|
@ -1,3 +1,6 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
/*
|
||||
* This conforms with the freedesktop.org Desktop Menu Specification version 0.92
|
||||
*
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
/*
|
||||
* This conforms with the freedesktop.org XDG Base Directory Specification version 0.6
|
||||
*
|
||||
|
@ -365,8 +368,7 @@ ecore_desktop_paths_file_find(Ecore_List * paths, const char *file, int sub,
|
|||
char temp[PATH_MAX];
|
||||
struct stat path_stat;
|
||||
|
||||
if (paths)
|
||||
{
|
||||
if (!paths) return NULL;
|
||||
ecore_list_goto_first(paths);
|
||||
while ((this_path = ecore_list_next(paths)) != NULL)
|
||||
{
|
||||
|
@ -392,7 +394,6 @@ ecore_desktop_paths_file_find(Ecore_List * paths, const char *file, int sub,
|
|||
if (path && (!func))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
@ -414,11 +415,17 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
Ecore_List *paths = NULL;
|
||||
Ecore_List *types = NULL;
|
||||
Ecore_List *gnome_extras = NULL;
|
||||
char path[PATH_MAX];
|
||||
Ecore_List *env_list;
|
||||
|
||||
|
||||
#ifdef KDE_SUPPORT
|
||||
Ecore_List *kdes = NULL;
|
||||
#endif
|
||||
|
||||
paths = ecore_list_new();
|
||||
if (!paths) return NULL;
|
||||
ecore_list_set_free_cb(paths, free);
|
||||
/* Don't sort them, as they are in preferred order from each source. */
|
||||
/* Merge the results, there are probably some duplicates. */
|
||||
|
||||
|
@ -431,14 +438,6 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
kdes = ecore_desktop_paths_to_list(kde);
|
||||
#endif
|
||||
|
||||
paths = ecore_list_new();
|
||||
if (paths)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
Ecore_List *env_list;
|
||||
|
||||
ecore_list_set_free_cb(paths, free);
|
||||
|
||||
if (before)
|
||||
{
|
||||
Ecore_List *befores;
|
||||
|
@ -464,11 +463,9 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
char *this_path;
|
||||
|
||||
ecore_list_goto_first(prepend_user_paths[path_type]);
|
||||
while ((this_path =
|
||||
ecore_list_next(prepend_user_paths[path_type])) != NULL)
|
||||
while ((this_path = ecore_list_next(prepend_user_paths[path_type])) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path,
|
||||
NULL);
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path, NULL);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -492,8 +489,7 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
while ((this_type = ecore_list_next(types)) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home,
|
||||
this_env,
|
||||
this_type);
|
||||
this_env, this_type);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -506,11 +502,9 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
char *this_path;
|
||||
|
||||
ecore_list_goto_first(append_user_paths[path_type]);
|
||||
while ((this_path =
|
||||
ecore_list_next(append_user_paths[path_type])) != NULL)
|
||||
while ((this_path = ecore_list_next(append_user_paths[path_type])) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path,
|
||||
NULL);
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path, NULL);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -520,11 +514,9 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
char *this_path;
|
||||
|
||||
ecore_list_goto_first(prepend_system_paths[path_type]);
|
||||
while ((this_path =
|
||||
ecore_list_next(prepend_system_paths[path_type])) != NULL)
|
||||
while ((this_path = ecore_list_next(prepend_system_paths[path_type])) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path,
|
||||
NULL);
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path, NULL);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -548,8 +540,7 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
while ((this_type = ecore_list_next(types)) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home,
|
||||
this_env,
|
||||
this_type);
|
||||
this_env, this_type);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -562,11 +553,9 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
char *this_path;
|
||||
|
||||
ecore_list_goto_first(append_system_paths[path_type]);
|
||||
while ((this_path =
|
||||
ecore_list_next(append_system_paths[path_type])) != NULL)
|
||||
while ((this_path = ecore_list_next(append_system_paths[path_type])) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path,
|
||||
NULL);
|
||||
_ecore_desktop_paths_massage_path(path, home, this_path, NULL);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -588,8 +577,8 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
ecore_list_goto_first(types);
|
||||
while ((this_type = ecore_list_next(types)) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home, this_gnome,
|
||||
this_type);
|
||||
_ecore_desktop_paths_massage_path(path, home,
|
||||
this_gnome, this_type);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -604,8 +593,8 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
ecore_list_goto_first(gnome_extras);
|
||||
while ((this_type = ecore_list_next(gnome_extras)) != NULL)
|
||||
{
|
||||
_ecore_desktop_paths_massage_path(path, home, this_gnome,
|
||||
this_type);
|
||||
_ecore_desktop_paths_massage_path(path, home,
|
||||
this_gnome, this_type);
|
||||
_ecore_desktop_paths_check_and_add(paths, path);
|
||||
}
|
||||
}
|
||||
|
@ -626,7 +615,6 @@ _ecore_desktop_paths_get(Ecore_Desktop_Paths_Type path_type,
|
|||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef KDE_SUPPORT
|
||||
E_FN_DEL(ecore_list_destroy, kdes);
|
||||
|
@ -645,15 +633,21 @@ _ecore_desktop_paths_massage_path(char *path, char *home, char *first,
|
|||
|
||||
/* Strip traling slash of first. */
|
||||
last = strlen(first) - 1;
|
||||
if ((last >= 0) && (first[last] == '/'))
|
||||
while ((last >= 0) && (first[last] == '/'))
|
||||
{
|
||||
first[last] = '\0';
|
||||
last--;
|
||||
}
|
||||
|
||||
if (second)
|
||||
{
|
||||
/* Strip traling slash of second. */
|
||||
last = strlen(second) - 1;
|
||||
if ((last >= 0) && (second[last] == '/'))
|
||||
while ((last >= 0) && (second[last] == '/'))
|
||||
{
|
||||
second[last] = '\0';
|
||||
last--;
|
||||
}
|
||||
}
|
||||
|
||||
if ((second) && (second[0] != '\0'))
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "Ecore_Desktop.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include "Ecore_Desktop.h"
|
||||
#include "ecore_desktop_private.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue