1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00

Fix bug when the HOME environment variable is empty

This commit is contained in:
John Zaitseff 2022-08-01 11:37:28 +10:00
parent 9f65939586
commit 9f5c0c361e
2 changed files with 8 additions and 1 deletions

3
NEWS
View File

@ -25,6 +25,9 @@ __ https://www.zap.org.au/
Version 7.17 (not yet released)
-------------------------------
Fixed a bug when the ``HOME`` environment variable is empty: use the
current directory instead.
Updated the Brazilian Portuguese, Norwegian Bokmål, Swedish, French,
Esperanto, Serbian, German and English translations (in that order), with
thanks to Rafael Fontenelle, Johnny A. Solbu, Anders Jonsson, Frédéric

View File

@ -56,6 +56,7 @@ wchar_t *mon_thousands_sep; // Locale's monetary thousands separator
#define APPIMAGE_NAME "AppRun.wrapped"
#define DIRSEP "/" // Directory separator
#define CURDIR "." // Current directory
#define HIDDEN_PATH "." // Hidden file start char
#define XDG_DATA_DEFAULT ".local" DIRSEP "share"
@ -314,7 +315,8 @@ static ssize_t b64decode (const void *restrict in, size_t inlen,
* Initialisation and environment function definitions *
************************************************************************/
// These functions are documented in the file "utils.h"
/* These functions are documented in the file "utils.h" or in the
comments above. */
/***********************************************************************/
@ -361,6 +363,8 @@ const char *home_directory (void)
if (home != NULL && *home != '\0') {
home_directory_str = xstrdup(home);
} else {
home_directory_str = xstrdup(CURDIR);
}
}