A couple of teeny tweaks (#3091)

* Don't get HOMEDRIVE unless needed

* Use put_char instead of put_str
This commit is contained in:
Andy Lester authored and GitHub committed 2024-04-23 16:10:42 +09:00
1 parent 6eff31a204
commit e4d0b12d7d
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -107,12 +107,12 @@ jv get_home() {
#else
home = getenv("USERPROFILE");
if (!home) {
char *hd = getenv("HOMEDRIVE");
if (!hd) hd = "";
home = getenv("HOMEPATH");
if (!home) {
ret = jv_invalid_with_msg(jv_string("Could not find home directory."));
} else {
const char *hd = getenv("HOMEDRIVE");
if (!hd) hd = "";
ret = jv_string_fmt("%s%s",hd,home);
}
} else {