Compare commits

..

No commits in common. "1da2f21763e395d93f74a18c994c3335696d19eb" and "ca5e32e06f73431df51d798b5b81d556dde809c1" have entirely different histories.

View File

@ -1,6 +1,5 @@
use bufio;
use errors;
use fmt;
use io;
use os;
use strings;
@ -42,7 +41,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("LANG")) {
yield match (get_locale_no_fallback("LC_LANG")) {
case let local: locale => yield local;
case => yield c;
};
@ -80,17 +79,15 @@ fn get_locale_conf() []str = {
case let file: io::file => yield file;
case => return locale_conf;
};
defer io::close(file)!;
defer io::close(file)!; // when the hell does closing a file fail????
let scanner = bufio::newscanner(file);
defer bufio::finish(&scanner);
for (true) {
match (bufio::scan_line(&scanner)) {
case let line: const str =>
append(locale_conf, strings::dup(line));
case =>
return locale_conf;
case let line: const str => append(locale_conf, line);
case => return locale_conf;
};
};
};