Cleanups
This commit is contained in:
parent
7829b3153c
commit
a3349dc364
|
@ -520,7 +520,7 @@ bool path_is_absolute(const char *path)
|
||||||
void path_resolve_realpath(char *buf, size_t size)
|
void path_resolve_realpath(char *buf, size_t size)
|
||||||
{
|
{
|
||||||
#ifndef RARCH_CONSOLE
|
#ifndef RARCH_CONSOLE
|
||||||
char tmp[PATH_MAX_LENGTH] = {0};
|
char tmp[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
strlcpy(tmp, buf, sizeof(tmp));
|
strlcpy(tmp, buf, sizeof(tmp));
|
||||||
|
|
||||||
|
@ -537,10 +537,6 @@ void path_resolve_realpath(char *buf, size_t size)
|
||||||
if (!realpath(tmp, buf))
|
if (!realpath(tmp, buf))
|
||||||
strlcpy(buf, tmp, size);
|
strlcpy(buf, tmp, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
|
||||||
(void)buf;
|
|
||||||
(void)size;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -633,14 +629,15 @@ void fill_pathname_resolve_relative(char *out_path,
|
||||||
const char *in_refpath, const char *in_path, size_t size)
|
const char *in_refpath, const char *in_path, size_t size)
|
||||||
{
|
{
|
||||||
if (path_is_absolute(in_path))
|
if (path_is_absolute(in_path))
|
||||||
rarch_assert(strlcpy(out_path, in_path, size) < size);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
rarch_assert(strlcpy(out_path, in_path, size) < size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rarch_assert(strlcpy(out_path, in_refpath, size) < size);
|
rarch_assert(strlcpy(out_path, in_refpath, size) < size);
|
||||||
path_basedir(out_path);
|
path_basedir(out_path);
|
||||||
rarch_assert(strlcat(out_path, in_path, size) < size);
|
rarch_assert(strlcat(out_path, in_path, size) < size);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fill_pathname_join:
|
* fill_pathname_join:
|
||||||
|
@ -712,13 +709,13 @@ void fill_short_pathname_representation(char* out_rep,
|
||||||
sizeof(path_short));
|
sizeof(path_short));
|
||||||
|
|
||||||
last_hash = (char*)strchr(path_short,'#');
|
last_hash = (char*)strchr(path_short,'#');
|
||||||
|
if(last_hash != NULL)
|
||||||
|
{
|
||||||
/* We handle paths like:
|
/* We handle paths like:
|
||||||
* /path/to/file.7z#mygame.img
|
* /path/to/file.7z#mygame.img
|
||||||
* short_name: mygame.img:
|
* short_name: mygame.img:
|
||||||
*/
|
*
|
||||||
if(last_hash != NULL)
|
* We check whether something is actually
|
||||||
{
|
|
||||||
/* We check whether something is actually
|
|
||||||
* after the hash to avoid going over the buffer.
|
* after the hash to avoid going over the buffer.
|
||||||
*/
|
*/
|
||||||
rarch_assert(strlen(last_hash) > 1);
|
rarch_assert(strlen(last_hash) > 1);
|
||||||
|
|
Loading…
Reference in New Issue