From e0868e7554a534acbd8c10afa495d3c27e4ce849 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Fri, 4 Oct 2024 23:54:08 -0400 Subject: [PATCH] Linux implementation parses /etc/locale.conf correctly Sometimes you just gotta strings::dup --- locale/+linux.ha | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/locale/+linux.ha b/locale/+linux.ha index fea8a72..b57c56c 100644 --- a/locale/+linux.ha +++ b/locale/+linux.ha @@ -1,5 +1,6 @@ use bufio; use errors; +use fmt; use io; use os; use strings; @@ -41,7 +42,7 @@ fn get_locale(var: str) locale = match (get_locale_no_fallback(var)) { case let local: locale => yield local; case => - yield match (get_locale_no_fallback("LC_LANG")) { + yield match (get_locale_no_fallback("LANG")) { case let local: locale => yield local; case => yield c; }; @@ -86,8 +87,10 @@ fn get_locale_conf() []str = { for (true) { match (bufio::scan_line(&scanner)) { - case let line: const str => append(locale_conf, line); - case => return locale_conf; + case let line: const str => + append(locale_conf, strings::dup(line)); + case => + return locale_conf; }; }; };