From 6fa38d95c39cb4b10739d6c8e6d76272d00d5181 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Mon, 12 Dec 2005 15:12:02 +0000 Subject: [PATCH] Fixed thread list when replylinkfloat is on (incorrect name position) --- docs/notework.txt | 2 ++ golded3/gemlst.cpp | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 90d7635..d98612c 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Fixed thread list when replylinkfloat is on (incorrect name position). + - Now exists all variants of the AREAFILE token in config examples. - Fix enviroment variables substitution. diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index ed675fa..0245f5e 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -962,7 +962,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) { else if (CFG->replylinkfloat) { size_t bylen = strlen(msg.By()); - if ((buf2len + bylen) > tdlen) + if ((buf2len + bylen) > (tdlen - 1)) new_hoffset = (buf2len + bylen)-tdlen+1; else new_hoffset = 0; @@ -970,10 +970,18 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) { attr = sattr; } - size_t buflen = strlen(&buf2[h_offset]); + size_t buflen = (buf2len > h_offset) ? strlen(&buf2[h_offset]) : 0; if (buflen < tdlen) { - strxcpy(buf, msg.By(), tdlen - buflen); + if (CFG->replylinkfloat && (buf2len < h_offset)) + { + size_t bylen = strlen(msg.By()); + size_t pos = (bylen < (h_offset-buf2len)) ? bylen : h_offset-buf2len; + strxcpy(buf, &msg.By()[pos], tdlen); + } + else + strxcpy(buf, msg.By(), tdlen - buflen); + window.prints(pos, 8 + buflen, attr, buf); } }