mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
showId: Handle empty attribute names
We should probably disallow these, but until then, we shouldn't barf with an assertion failure. Fixes #738.
This commit is contained in:
parent
338880ee6f
commit
a9faa7bbce
1 changed files with 3 additions and 2 deletions
|
@ -30,8 +30,9 @@ static void showString(std::ostream & str, const string & s)
|
|||
|
||||
static void showId(std::ostream & str, const string & s)
|
||||
{
|
||||
assert(!s.empty());
|
||||
if (s == "if")
|
||||
if (s.empty())
|
||||
str << "\"\"";
|
||||
else if (s == "if") // FIXME: handle other keywords
|
||||
str << '"' << s << '"';
|
||||
else {
|
||||
char c = s[0];
|
||||
|
|
Loading…
Reference in a new issue