Fixed configuration file parsing: byLine requires that the file be
opened in text mode to properly handle CRLF line endings. Added build
batch file.
This commit is contained in:
Hackerpilot 2013-09-01 02:23:01 -07:00
parent 204ab386eb
commit 8cc0f2546d
2 changed files with 15 additions and 12 deletions

2
build.bat Normal file
View File

@ -0,0 +1,2 @@
dmd -wi client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -ofdcd-client -L/exet:nt/su:windows:4.0
dmd -wi -g server.d modulecache.d actypes.d messages.d constants.d acvisitor.d autocomplete.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner/ -ofdcd-server

View File

@ -143,19 +143,20 @@ int main(string[] args)
string[] loadConfiguredImportDirs()
{
version(Windows)
{
string fullPath = buildPath(getcwd(), CONFIG_FILE_PATH);
}
else version(Posix)
{
string fullPath = expandTilde(CONFIG_FILE_PATH);
}
version(Windows)
{
string fullPath = buildPath(getcwd(), CONFIG_FILE_PATH);
}
else version(Posix)
{
string fullPath = expandTilde(CONFIG_FILE_PATH);
}
if (!exists(fullPath))
return [];
File f = File(fullPath);
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
if (!exists(fullPath))
return [];
File f = File(fullPath, "rt");
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
}
void printHelp(string programName)