]> granicus.if.org Git - mutt/commitdiff
Fix truncation logic for soft-padding (Closes #3035).
authorRocco Rutte <pdmef@gmx.net>
Wed, 20 Feb 2008 11:02:03 +0000 (12:02 +0100)
committerRocco Rutte <pdmef@gmx.net>
Wed, 20 Feb 2008 11:02:03 +0000 (12:02 +0100)
ChangeLog
muttlib.c

index ce0eb34aa6755be9c62eec72a4b08802a99fea60..e9a7ae8cdc6b8c532adf297dfa23d54e67e6daf4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-29 21:06 -0800  Brendan Cully  <brendan@kublai.com>  (fd741c1922f3)
+
+       * hg-commit: Fix typo in hg-commit
+
+2008-01-29 21:05 -0800  Benno Schulenberg  <i18n@benno.vertaalt.nl>  (95807c4b824f)
+
+       * ChangeLog, po/nl.po: Improvements to the Dutch translation
+
 2008-01-17 17:32 +0100  Rocco Rutte  <pdmef@gmx.net>  (039d939d8c3e)
 
        * browser.h: Use 'unsigned int' for file browser state to browse huge
index 46e074819c003fdb8bd9b78f4a678c826cf0d85a..90ed9bb245bc2eb6e4ee527f6622454bcc897cc1 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1231,13 +1231,12 @@ void mutt_FormatString (char *dest,             /* output buffer */
          }
          else if (soft && pad < 0)
          {
-           /* set wptr and wlen back just enough bytes to make sure buf
-            * fits on screen, \0-terminate dest so mutt_wstr_trunc()
-            * can correctly compute string's length */
-           if (pad < -wlen)
-             pad = -wlen;
+           /* \0-terminate dest for length computation in mutt_wstr_trunc() */
            *wptr = 0;
-           wlen = mutt_wstr_trunc (dest, wlen + pad, col + pad, &col);
+           /* make sure right part is as most as wide as display */
+           len = mutt_wstr_trunc (buf, destlen, COLS, &wid);
+           /* truncate left so that right part fits completely in */
+           wlen = mutt_wstr_trunc (dest, destlen - len, COLS - wid, &col);
            wptr = dest + wlen;
          }
          if (len + wlen > destlen)