mirror of https://github.com/adamdruppe/arsd.git
Gah, need to use .get to handle case when environment variable isn't defined.
Otherwise it would throw a runtime exception. :-(
This commit is contained in:
parent
3931c20de4
commit
310b46c992
|
@ -303,7 +303,7 @@ struct Terminal {
|
||||||
bool terminalInFamily(string[] terms...) {
|
bool terminalInFamily(string[] terms...) {
|
||||||
import std.process;
|
import std.process;
|
||||||
import std.string;
|
import std.string;
|
||||||
auto term = environment["TERM"];
|
auto term = environment.get("TERM");
|
||||||
foreach(t; terms)
|
foreach(t; terms)
|
||||||
if(indexOf(term, t) != -1)
|
if(indexOf(term, t) != -1)
|
||||||
return true;
|
return true;
|
||||||
|
@ -393,9 +393,9 @@ struct Terminal {
|
||||||
import std.string;
|
import std.string;
|
||||||
import std.array;
|
import std.array;
|
||||||
|
|
||||||
string termcapData = environment["TERMCAP"];
|
string termcapData = environment.get("TERMCAP");
|
||||||
if(termcapData.length == 0) {
|
if(termcapData.length == 0) {
|
||||||
termcapData = getTermcapDatabase(environment["TERM"]);
|
termcapData = getTermcapDatabase(environment.get("TERM"));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto e = replace(termcapData, "\\\n", "\n");
|
auto e = replace(termcapData, "\\\n", "\n");
|
||||||
|
|
Loading…
Reference in New Issue