Forgot to add a correction.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-11-29 12:24:00 +02:00
parent 7624b27409
commit 18284289a0
3 changed files with 30 additions and 6 deletions

View File

@ -59,8 +59,19 @@ int main(int argc, char *argv[])
BrInitError error;
if (br_init (&error))
{
exe_dir = br_find_exe_dir (nullptr);
u_setDataDirectory(exe_dir);
char *path = br_find_exe_dir(nullptr);
if (path)
{
const char* correction = "/../share/icu";
exe_dir = static_cast<char *> (malloc(strlen(path)+strlen(correction)+1));
if(exe_dir)
{
strcpy(exe_dir, path);
strcat(exe_dir, correction);
u_setDataDirectory(exe_dir);
}
free(path);
}
}
auto FreeMemory = qScopeGuard([exe_dir] {free(exe_dir);});
@ -102,7 +113,7 @@ int main(int argc, char *argv[])
#if defined(APPIMAGE) && defined(Q_OS_LINUX)
if (exe_dir)
{
qDebug() << "Path to exe dir:" << exe_dir;
qDebug() << "Path to ICU folder:" << exe_dir;
}
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX)

View File

@ -61,8 +61,19 @@ int main(int argc, char *argv[])
BrInitError error;
if (br_init (&error))
{
exe_dir = br_find_exe_dir (nullptr);
u_setDataDirectory(exe_dir);
char *path = br_find_exe_dir(nullptr);
if (path)
{
const char* correction = "/../share/icu";
exe_dir = static_cast<char *> (malloc(strlen(path)+strlen(correction)+1));
if(exe_dir)
{
strcpy(exe_dir, path);
strcat(exe_dir, correction);
u_setDataDirectory(exe_dir);
}
free(path);
}
}
auto FreeMemory = qScopeGuard([exe_dir] {free(exe_dir);});
@ -134,7 +145,7 @@ int main(int argc, char *argv[])
#if defined(APPIMAGE) && defined(Q_OS_LINUX)
if (exe_dir)
{
qDebug() << "Path to exe dir:" << exe_dir;
qDebug() << "Path to ICU folder:" << exe_dir;
}
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX)

View File

@ -244,6 +244,8 @@ _br_find_exe_for_symbol (const void *symbol, BrInitError *error)
char *new_address_string = (char *) realloc (address_string, address_string_len);
if (new_address_string == NULL){
*error = BR_INIT_ERROR_NOMEM;
free (address_string);
fclose (f);
return (char *) NULL;
}
else