kwo pushed a commit to branch master. http://git.enlightenment.org/e16/e16.git/commit/?id=11d6bbb3f477cf301f548fef440330cc03b49555
commit 11d6bbb3f477cf301f548fef440330cc03b49555 Author: Kim Woelders <[email protected]> Date: Sat Dec 30 11:33:05 2017 +0100 theme.c: Cosmetics - Rename _ThemeCheckPath() to _ThemeCheckDir() and let it return a "boolean". - Change some 4096 to FILEPATH_LEN_MAX. --- src/theme.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/theme.c b/src/theme.c index 0a73ad24..f7b3c6f8 100644 --- a/src/theme.c +++ b/src/theme.c @@ -31,7 +31,7 @@ static void _ThemePathsUpdate(void) { - char paths[4096]; + char paths[FILEPATH_LEN_MAX]; Esnprintf(paths, sizeof(paths), "%s/themes:%s/themes:%s", EDirUser(), EDirRoot(), (Conf.theme.extra_path) ? Conf.theme.extra_path : ""); @@ -39,8 +39,8 @@ _ThemePathsUpdate(void) } /* Check if this is a theme dir */ -static const char * -_ThemeCheckPath(const char *path) +static int +_ThemeCheckDir(const char *path) { static const char *const theme_files[] = { "init.cfg", @@ -51,16 +51,16 @@ _ThemeCheckPath(const char *path) }; const char *tf; int i; - char s[4096]; + char s[FILEPATH_LEN_MAX]; for (i = 0; (tf = theme_files[i]); i++) { Esnprintf(s, sizeof(s), "%s/%s", path, tf); if (!isfile(s)) - return NULL; + return 0; } - return path; + return 1; } char * @@ -108,10 +108,10 @@ _append_merge_dir(char *dir, char ***list, int *count) if (isdir(ss)) { - if (_ThemeCheckPath(ss)) + if (_ThemeCheckDir(ss)) goto got_one; Esnprintf(ss, sizeof(ss), "%s/%s/e16", dir, str[i]); - if (_ThemeCheckPath(ss)) + if (_ThemeCheckDir(ss)) goto got_one; continue; } @@ -216,7 +216,7 @@ _ThemeExtract(const char *path) Esystem(s); done: - if (_ThemeCheckPath(path)) + if (_ThemeCheckDir(path)) return Estrdup(path); /* failed */ @@ -229,7 +229,7 @@ ThemeFind(const char *theme) static const char *const default_themes[] = { "DEFAULT", "winter", "BrushedMetal-Tigert", "ShinyMetal", NULL }; - char tdir[4096], *path; + char tdir[FILEPATH_LEN_MAX], *path; char **lst; int i, j, num; --
