Ticket #12091: 0002-fixup-improve-option_column_width-calculation.patch

File 0002-fixup-improve-option_column_width-calculation.patch, 1017 bytes (added by Timo Weingärtner <timo@…>, 6 years ago)
  • src/options_description.cpp

    From 128d99656fbaff80b7361b8f5d8e1f97289631b4 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Timo=20Weing=C3=A4rtner?= <timo@tiwe.de>
    Date: Tue, 11 Oct 2016 23:09:27 +0200
    Subject: [PATCH 2/2] fixup! improve option_column_width calculation
    
    fix off-by-one after ss has the same length as in get_option_column_width()
    ---
     src/options_description.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/options_description.cpp b/src/options_description.cpp
    index b145222..0c62a34 100644
    a b namespace boost { namespace program_options {  
    589589
    590590            if (!opt.description().empty())
    591591            {
    592                 if (ss.str().size() >= first_column_width)
     592                if (ss.str().size() > first_column_width)
    593593                {
    594594                   os.put('\n'); // first column is too long, lets put description in new line
    595595                   for (unsigned pad = first_column_width; pad > 0; --pad)