[Theme] Try to fix importing of theme.

- Fix the two place of resolving into one method.
- Do not accept file in CWD.
- Prefer file if it exists in same directory as parent file that
  imported it.

fixes: #1889
This commit is contained in:
Dave Davenport
2023-08-15 19:12:14 +02:00
parent 528419269e
commit ad06fb9516
10 changed files with 56 additions and 32 deletions

View File

@@ -397,8 +397,9 @@ char *helper_string_replace_if_exists(char *string, ...);
*
* @returns path to theme or copy of filename if not found.
*/
char *helper_get_theme_path(const char *file, const char **ext)
__attribute__((nonnull));
char *helper_get_theme_path(const char *file, const char **ext,
const char *parent_dir)
__attribute__((nonnull(1, 2)));
/**
* @param name The name of the element to find.