summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
Diffstat (limited to 'src/support')
-rw-r--r--src/support/name.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/support/name.cpp b/src/support/name.cpp
index 4e53e3f83..4c599defc 100644
--- a/src/support/name.cpp
+++ b/src/support/name.cpp
@@ -46,7 +46,7 @@ std::ostream& Name::print(std::ostream& o) const {
// TODO: This is not spec-compliant since the spec does not yet support
// quoted identifiers and has a limited set of valid idchars.
o << '$';
- if (std::all_of(str.begin(), str.end(), isIDChar)) {
+ if (size() >= 1 && std::all_of(str.begin(), str.end(), isIDChar)) {
return o << str;
} else {
return String::printEscaped(o, str);