Bladeren bron

Force server database path

Use path relative to server executable instead of current working
directory.
master
TheoryOfNekomata 1 jaar geleden
bovenliggende
commit
d0c66fe817
2 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. +6
    -1
      src/packages/server/db/IZ_repo.c
  2. +1
    -0
      src/packages/server/db/IZ_repo.h

+ 6
- 1
src/packages/server/db/IZ_repo.c Bestand weergeven

@@ -40,7 +40,12 @@ IZ_ProcedureResult IZ_RepoInitialize(IZ_RepoState* state, const char* config_pat
if (IZ_RepoInitializeConfig(state, config_path, argc, argv) < 0) {
return -2;
}
sqlite3_open_v2(state->config.path, &state->db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
const char* base_path = SDL_GetBasePath();
char config_path_dir[128];
IZ_memcpy(config_path_dir, 128, base_path, 128);
IZ_strcat(config_path_dir, 128, "/");
IZ_strcat(config_path_dir, 128, state->config.path);
sqlite3_open_v2(config_path_dir, &state->db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
return 0;
}



+ 1
- 0
src/packages/server/db/IZ_repo.h Bestand weergeven

@@ -4,6 +4,7 @@
#include <minIni.h>
#include <sqlite3.h>
#include <string.h>
#include <SDL_filesystem.h>
#include "../../common/IZ_common.h"
#include "../../config/IZ_config.h"
#include "../../stdinc/IZ_string.h"


Laden…
Annuleren
Opslaan