From 628db79fa23c83e8794c216e9a216002db3b66ad Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Sat, 6 Apr 2024 22:01:55 -0500 Subject: [PATCH 1/2] Don't get HOMEDRIVE unless needed --- src/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index 4a5ba98cdd..00c297997f 100644 --- a/src/util.c +++ b/src/util.c @@ -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 { From 51f4b2b1940f38d052493756b40072d9fd3ada50 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Sat, 6 Apr 2024 23:15:49 -0500 Subject: [PATCH 2/2] Use put_char instead of put_str --- src/jv_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jv_print.c b/src/jv_print.c index 390b38c929..ffe1523400 100644 --- a/src/jv_print.c +++ b/src/jv_print.c @@ -206,7 +206,7 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI if (jv_get_kind(msg) == JV_KIND_STRING) { put_str("", F, S, flags & JV_PRINT_ISATTY); + put_char('>', F, S, flags & JV_PRINT_ISATTY); } else { put_str("", F, S, flags & JV_PRINT_ISATTY); } @@ -259,7 +259,7 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI put_str("[]", F, S, flags & JV_PRINT_ISATTY); break; } - put_str("[", F, S, flags & JV_PRINT_ISATTY); + put_char('[', F, S, flags & JV_PRINT_ISATTY); jv_array_foreach(x, i, elem) { if (i!=0) { if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);