mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 02:38:11 +00:00
Merge branch 'master' of github.com:Themaister/SSNES
This commit is contained in:
commit
56a1877d15
15
file.c
15
file.c
@ -1008,3 +1008,18 @@ void fill_pathname_dir(char *in_dir, const char *in_basename, const char *replac
|
||||
ssnes_assert(strlcat(in_dir, base, size) < size);
|
||||
ssnes_assert(strlcat(in_dir, replace, size) < size);
|
||||
}
|
||||
|
||||
void fill_pathname_base(char *out_dir, const char *in_path, size_t size)
|
||||
{
|
||||
const char *ptr = strrchr(in_path, '/');
|
||||
if (!ptr)
|
||||
ptr = strrchr(in_path, '\\');
|
||||
|
||||
if (ptr)
|
||||
ptr++;
|
||||
else
|
||||
ptr = in_path;
|
||||
|
||||
ssnes_assert(strlcpy(out_dir, ptr, size) < size);
|
||||
}
|
||||
|
||||
|
3
file.h
3
file.h
@ -71,4 +71,7 @@ void fill_pathname_noext(char *out_path, const char *in_path, const char *replac
|
||||
// in_dir = "/tmp/some_dir/foo.c.asm"
|
||||
void fill_pathname_dir(char *in_dir, const char *in_basename, const char *replace, size_t size);
|
||||
|
||||
// Copies basename of in_path into out_path.
|
||||
void fill_pathname_base(char *out_path, const char *in_path, size_t size);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user