Create fill_pathname_base_ext

This commit is contained in:
twinaphex 2016-07-01 11:12:24 +02:00
parent e36107530e
commit 45c33c7acf
3 changed files with 17 additions and 6 deletions

View File

@ -351,6 +351,13 @@ void fill_pathname_base_noext(char *out, const char *in_path, size_t size)
path_remove_extension(out);
}
void fill_pathname_base_ext(char *out, const char *in_path, const char *ext,
size_t size)
{
fill_pathname_base_noext(out, in_path, size);
strlcat(out, ext, size);
}
/**
* fill_pathname_basedir:
* @out_dir : output directory

View File

@ -254,6 +254,10 @@ void fill_pathname_base(char *out_path, const char *in_path, size_t size);
void fill_pathname_base_noext(char *out_dir,
const char *in_path, size_t size);
void fill_pathname_base_ext(char *out,
const char *in_path, const char *ext,
size_t size);
/**
* fill_pathname_basedir:
* @out_dir : output directory

View File

@ -60,17 +60,17 @@ void menu_shader_manager_init(menu_handle_t *menu)
* conflicts on menu.cgp/menu.glslp. */
if (config_path)
{
fill_pathname_base_noext(menu->default_glslp, config_path,
fill_pathname_base_ext(menu->default_glslp, config_path,
".glslp",
sizeof(menu->default_glslp));
strlcat(menu->default_glslp, ".glslp", sizeof(menu->default_glslp));
fill_pathname_base_noext(menu->default_cgp, config_path,
fill_pathname_base_ext(menu->default_cgp, config_path,
".cgp",
sizeof(menu->default_cgp));
strlcat(menu->default_cgp, ".cgp", sizeof(menu->default_cgp));
fill_pathname_base_noext(menu->default_slangp, config_path,
fill_pathname_base_ext(menu->default_slangp, config_path,
".slangp",
sizeof(menu->default_slangp));
strlcat(menu->default_slangp, ".slangp", sizeof(menu->default_slangp));
}
else
{