From cfb7fdc9875235a61e3fd694ae8ac38f35a92fe5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 15 Jun 2014 22:31:13 -0400 Subject: [PATCH] Date - Uses mk_wcwidth to calculate the printed width of a character in a date format that is not recognized, instead of simply assuming '1'. --- src/Date.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Date.cpp b/src/Date.cpp index df909dd7c..db9050e19 100644 --- a/src/Date.cpp +++ b/src/Date.cpp @@ -553,8 +553,8 @@ int Date::length (const std::string& format) case 'A': case 'B': total += 10; break; - // TODO This should be a calculated character width, not necessarily 1. - default: total += 1; break; + // Calculate the width, don't assume a single character width. + default: total += mk_wcwidth (*i); break; } }