add get_my_user_directory() to centralize HOME processing

This commit is contained in:
Philippe Teuwen committed 2019-09-12 20:13:01 +02:00
1 parent da68369e02
commit 46574ae0f5
5 files changed
+22 -10

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ static void fPrintAndLog(FILE *stream, const char *fmt, ...);
int searchHomeFilePath(char **foundpath, const char *filename, bool create_home) {
if (foundpath == NULL)
return PM3_EINVARG;
char *user_path = getenv("HOME");
const char *user_path = get_my_user_directory();
if (user_path == NULL) {
fprintf(stderr, "Could not retrieve $HOME from the environment\n");
return PM3_EFILE;