summaryrefslogtreecommitdiff
path: root/src/format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/format.cc')
-rw-r--r--src/format.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/format.cc b/src/format.cc
index e910ce3b..f26a86a1 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -355,8 +355,11 @@ string format_t::real_calc(scope_t& scope)
}
DEBUG("format.expr", "value = (" << value << ")");
- value.print(out, static_cast<int>(elem->min_width), -1,
- ! elem->has_flags(ELEMENT_ALIGN_LEFT));
+ if (elem->min_width > 0)
+ value.print(out, static_cast<int>(elem->min_width), -1,
+ ! elem->has_flags(ELEMENT_ALIGN_LEFT));
+ else
+ out << value.to_string();
}
catch (const calc_error&) {
add_error_context(_("While calculating format expression:"));