mirror of
https://git.zap.org.au/git/trader.git
synced 2025-06-30 22:19:26 -04:00
Fix bug when the HOME environment variable is empty
This commit is contained in:
parent
9f65939586
commit
9f5c0c361e
3
NEWS
3
NEWS
@ -25,6 +25,9 @@ __ https://www.zap.org.au/
|
|||||||
Version 7.17 (not yet released)
|
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,
|
Updated the Brazilian Portuguese, Norwegian Bokmål, Swedish, French,
|
||||||
Esperanto, Serbian, German and English translations (in that order), with
|
Esperanto, Serbian, German and English translations (in that order), with
|
||||||
thanks to Rafael Fontenelle, Johnny A. Solbu, Anders Jonsson, Frédéric
|
thanks to Rafael Fontenelle, Johnny A. Solbu, Anders Jonsson, Frédéric
|
||||||
|
@ -56,6 +56,7 @@ wchar_t *mon_thousands_sep; // Locale's monetary thousands separator
|
|||||||
#define APPIMAGE_NAME "AppRun.wrapped"
|
#define APPIMAGE_NAME "AppRun.wrapped"
|
||||||
|
|
||||||
#define DIRSEP "/" // Directory separator
|
#define DIRSEP "/" // Directory separator
|
||||||
|
#define CURDIR "." // Current directory
|
||||||
#define HIDDEN_PATH "." // Hidden file start char
|
#define HIDDEN_PATH "." // Hidden file start char
|
||||||
#define XDG_DATA_DEFAULT ".local" DIRSEP "share"
|
#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 *
|
* 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') {
|
if (home != NULL && *home != '\0') {
|
||||||
home_directory_str = xstrdup(home);
|
home_directory_str = xstrdup(home);
|
||||||
|
} else {
|
||||||
|
home_directory_str = xstrdup(CURDIR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user