rename global session

This commit is contained in:
Philippe Teuwen 2021-08-21 20:31:05 +02:00
parent 6a2f2b3979
commit dd3b63ae32
20 changed files with 258 additions and 258 deletions

View file

@ -237,14 +237,14 @@ bool create_path(const char *dirname) {
bool setDefaultPath(savePaths_t pathIndex, const char *Path) {
if (pathIndex < spItemCount) {
if ((Path == NULL) && (session.defaultPaths[pathIndex] != NULL)) {
free(session.defaultPaths[pathIndex]);
session.defaultPaths[pathIndex] = NULL;
if ((Path == NULL) && (g_session.defaultPaths[pathIndex] != NULL)) {
free(g_session.defaultPaths[pathIndex]);
g_session.defaultPaths[pathIndex] = NULL;
}
if (Path != NULL) {
session.defaultPaths[pathIndex] = (char *)realloc(session.defaultPaths[pathIndex], strlen(Path) + 1);
strcpy(session.defaultPaths[pathIndex], Path);
g_session.defaultPaths[pathIndex] = (char *)realloc(g_session.defaultPaths[pathIndex], strlen(Path) + 1);
strcpy(g_session.defaultPaths[pathIndex], Path);
}
return true;
}