Improvements to path handling. Patch from bit.

This commit is contained in:
SarahW 2017-07-06 21:25:10 +01:00
commit 807b710a5d
55 changed files with 588 additions and 368 deletions

View file

@ -3,6 +3,7 @@
#include "allegro-main.h"
#include "allegro-gui.h"
#include "config.h"
#include "paths.h"
#undef printf
typedef struct config_t
{
@ -83,7 +84,7 @@ static int new_proc(int msg, DIALOG *d, int c)
if (c == 1)
{
sprintf(config_file_default, "%sconfigs/%s.cfg", pcempath, config_name);
sprintf(config_file_default, "%s%s.cfg", configs_path, config_name);
c = settings_configure();
free_configs();
populate_configs();
@ -106,7 +107,7 @@ static int config_proc(int msg, DIALOG *d, int c)
if (name)
{
sprintf(config_file_default, "%sconfigs/%s.cfg", pcempath, name);
sprintf(config_file_default, "%s%s.cfg", configs_path, name);
loadconfig(NULL);
return settings_configure();
}
@ -127,7 +128,7 @@ static int hdd_proc(int msg, DIALOG *d, int c)
if (name)
{
sprintf(config_file_default, "%sconfigs/%s.cfg", pcempath, name);
sprintf(config_file_default, "%s%s.cfg", configs_path, name);
loadconfig(NULL);
return disc_hdconf();
}
@ -165,8 +166,8 @@ static void populate_configs()
char cfg[512];
config_t *config = NULL;
strcpy(cfg, pcempath);
strcat(cfg, "/configs/*.cfg");
strcpy(cfg, configs_path);
strcat(cfg, "*.cfg");
printf("cfg %s\n", cfg);
if (al_findfirst(cfg, &info, FA_ALL))
return;
@ -247,7 +248,7 @@ int config_sel()
if (name)
{
sprintf(config_file_default, "%sconfigs/%s.cfg", pcempath, name);
sprintf(config_file_default, "%s%s.cfg", configs_path, name);
pclog("config_file_default=%s\n", config_file_default);
free_configs();
return 0;