summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/wpref.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2025-09-20 19:19:34 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2025-09-20 19:19:34 +0200
commite7d20cf352688bf717a01f4e6d9e6f497c2bea4c (patch)
treecfd2ef9b569f49af985a6f1ec44f2614f63c8e78 /app/wlib/gtklib/wpref.c
parenta14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (diff)
New upstream version 5.3.1Beta2upstream/5.3.1Beta2
Diffstat (limited to 'app/wlib/gtklib/wpref.c')
-rw-r--r--app/wlib/gtklib/wpref.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/wlib/gtklib/wpref.c b/app/wlib/gtklib/wpref.c
index 356dd95..d83f3e9 100644
--- a/app/wlib/gtklib/wpref.c
+++ b/app/wlib/gtklib/wpref.c
@@ -107,6 +107,11 @@ const char * wGetAppLibDir( void )
return appLibDir;
}
+ strcpy(appLibDir, XTRKCAD_INSTALL_PREFIX "/" XTRKCAD_SHARE_INSTALL_DIR);
+ if ((stat( appLibDir, &buf) == 0 ) && S_ISDIR(buf.st_mode)) {
+ return appLibDir;
+ }
+
char * dir1 = "/usr/share/";
char * dir2 = "/usr/local/share/";
char * beta = "";
@@ -265,13 +270,15 @@ wlibSetProfileFilename(char *name)
if (name && name[0]) {
size_t length;
length = snprintf(profileFile, 0, "%s", name);
- profileFile = malloc(length + sizeof(NULL));
+ length += sizeof("");
+ profileFile = malloc(length);
snprintf( profileFile, length, "%s", name );
} else {
size_t length;
length = snprintf(profileFile, 0, "%s/%s.rc", workDir, wConfigName );
- profileFile = malloc(length + sizeof(NULL));
- length = snprintf(profileFile, length+sizeof(NULL), "%s/%s.rc", workDir, wConfigName );
+ length += sizeof("");
+ profileFile = malloc(length);
+ length = snprintf(profileFile, length, "%s/%s.rc", workDir, wConfigName );
}
}
@@ -631,4 +638,4 @@ wPrefFormatLine(const char* section, const char* name, const char* value, char*
value = "";
}
sprintf(result, "%s.%s: %s", section, name, value);
-} \ No newline at end of file
+}