Compare commits
2 Commits
ca5e32e06f
...
1da2f21763
Author | SHA1 | Date | |
---|---|---|---|
1da2f21763 | |||
e0868e7554 |
@ -1,5 +1,6 @@
|
|||||||
use bufio;
|
use bufio;
|
||||||
use errors;
|
use errors;
|
||||||
|
use fmt;
|
||||||
use io;
|
use io;
|
||||||
use os;
|
use os;
|
||||||
use strings;
|
use strings;
|
||||||
@ -41,7 +42,7 @@ fn get_locale(var: str) locale =
|
|||||||
match (get_locale_no_fallback(var)) {
|
match (get_locale_no_fallback(var)) {
|
||||||
case let local: locale => yield local;
|
case let local: locale => yield local;
|
||||||
case =>
|
case =>
|
||||||
yield match (get_locale_no_fallback("LC_LANG")) {
|
yield match (get_locale_no_fallback("LANG")) {
|
||||||
case let local: locale => yield local;
|
case let local: locale => yield local;
|
||||||
case => yield c;
|
case => yield c;
|
||||||
};
|
};
|
||||||
@ -79,15 +80,17 @@ fn get_locale_conf() []str = {
|
|||||||
case let file: io::file => yield file;
|
case let file: io::file => yield file;
|
||||||
case => return locale_conf;
|
case => return locale_conf;
|
||||||
};
|
};
|
||||||
defer io::close(file)!; // when the hell does closing a file fail????
|
defer io::close(file)!;
|
||||||
|
|
||||||
let scanner = bufio::newscanner(file);
|
let scanner = bufio::newscanner(file);
|
||||||
defer bufio::finish(&scanner);
|
defer bufio::finish(&scanner);
|
||||||
|
|
||||||
for (true) {
|
for (true) {
|
||||||
match (bufio::scan_line(&scanner)) {
|
match (bufio::scan_line(&scanner)) {
|
||||||
case let line: const str => append(locale_conf, line);
|
case let line: const str =>
|
||||||
case => return locale_conf;
|
append(locale_conf, strings::dup(line));
|
||||||
|
case =>
|
||||||
|
return locale_conf;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user