Merge pull request #6233 from fr500/fixes

Fixes
This commit is contained in:
Twinaphex 2018-02-04 18:17:37 +01:00 committed by GitHub
commit 39406c3357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -810,7 +810,7 @@ bool win32_window_create(void *data, unsigned style,
notification_handler = RegisterDeviceNotification(
main_window.hwnd, &notification_filter, DEVICE_NOTIFY_WINDOW_HANDLE);
if (notification_handler)
if (!notification_handler)
RARCH_ERR("Error registering for notifications\n");
#endif

13
paths.c
View File

@ -143,7 +143,7 @@ void path_set_redirect(void)
}
}
/* Set savefile directory if empty based on content directory */
/* Set savefile directory if empty to content directory */
if (string_is_empty(new_savefile_dir) || settings->bools.savefiles_in_content_dir)
{
strlcpy(new_savefile_dir, path_main_basename,
@ -319,6 +319,7 @@ static bool path_init_subsystem(void)
{
union string_list_elem_attr attr;
char ext[32];
char savename[PATH_MAX_LENGTH];
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
char *path = (char*)malloc(
PATH_MAX_LENGTH * sizeof(char));
@ -329,19 +330,21 @@ static bool path_init_subsystem(void)
path[0] = ext[0] = '\0';
snprintf(ext, sizeof(ext), ".%s", mem->extension);
strlcpy(savename, subsystem_fullpaths->elems[i].data, sizeof(savename));
path_remove_extension(savename);
if (path_is_directory(dir_get(RARCH_DIR_SAVEFILE)))
if (path_is_directory(dir_get(RARCH_DIR_CURRENT_SAVEFILE)))
{
/* Use SRAM dir */
/* Redirect content fullpath to save directory. */
strlcpy(path, dir_get(RARCH_DIR_SAVEFILE), path_size);
strlcpy(path, dir_get(RARCH_DIR_CURRENT_SAVEFILE), path_size);
fill_pathname_dir(path,
subsystem_fullpaths->elems[i].data, ext,
savename, ext,
path_size);
}
else
{
fill_pathname(path, subsystem_fullpaths->elems[i].data,
fill_pathname(path, savename,
ext, path_size);
}