mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 15:02:42 +01:00
Fix another machine config parsing bug
We were ignorning the result of `trim`, and after my last change we were also trimmming too early.
This commit is contained in:
parent
d45067177e
commit
b74b0f4e1c
2 changed files with 19 additions and 4 deletions
|
|
@ -106,13 +106,14 @@ static std::vector<std::string> expandBuilderLines(const std::string & builders)
|
|||
{
|
||||
std::vector<std::string> result;
|
||||
for (auto line : tokenizeString<std::vector<std::string>>(builders, "\n")) {
|
||||
trim(line);
|
||||
line.erase(std::find(line.begin(), line.end(), '#'), line.end());
|
||||
for (auto entry : tokenizeString<std::vector<std::string>>(line, ";")) {
|
||||
if (entry.empty()) continue;
|
||||
entry = trim(entry);
|
||||
|
||||
if (entry[0] == '@') {
|
||||
const std::string path = trim(std::string(entry, 1));
|
||||
if (entry.empty()) {
|
||||
// skip blank entries
|
||||
} else if (entry[0] == '@') {
|
||||
const std::string path = trim(std::string_view{entry}.substr(1));
|
||||
std::string text;
|
||||
try {
|
||||
text = readFile(path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue