diff options
Diffstat (limited to 'third_party/nix/src/libexpr/attr-path.cc')
-rw-r--r-- | third_party/nix/src/libexpr/attr-path.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/third_party/nix/src/libexpr/attr-path.cc b/third_party/nix/src/libexpr/attr-path.cc index 584f49d124ef..edab0b6df97f 100644 --- a/third_party/nix/src/libexpr/attr-path.cc +++ b/third_party/nix/src/libexpr/attr-path.cc @@ -19,14 +19,18 @@ static Strings parseAttrPath(const string& s) { if (i == s.end()) throw Error(format("missing closing quote in selection path '%1%'") % s); - if (*i == '"') break; + if (*i == '"') { + break; + } cur.push_back(*i++); } } else cur.push_back(*i); ++i; } - if (!cur.empty()) res.push_back(cur); + if (!cur.empty()) { + res.push_back(cur); + } return res; } @@ -44,7 +48,9 @@ Value* findAlongAttrPath(EvalState& state, const string& attrPath, /* Is i an index (integer) or a normal attribute name? */ enum { apAttr, apIndex } apType = apAttr; unsigned int attrIndex; - if (string2Int(attr, attrIndex)) apType = apIndex; + if (string2Int(attr, attrIndex)) { + apType = apIndex; + } /* Evaluate the expression. */ Value* vNew = state.allocValue(); |