summaryrefslogtreecommitdiff
path: root/tipper/popwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r--tipper/popwin.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp
index ccac277..bc570b5 100644
--- a/tipper/popwin.cpp
+++ b/tipper/popwin.cpp
@@ -134,14 +134,16 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
int buff_pos, i = 0, size = _tcslen(pwd->clcit.text);
bool top_message = false;
- if(swzText[0] != _T('<')) {
- while(swzText[i] != _T('\n') && swzText[i] != _T('\r') && i < size && i < 2048) {
- buff[i] = swzText[i];
+ while(i < size && swzText[i] != _T('<')) {
+ buff_pos = 0;
+ while(swzText[i] != _T('\n') && swzText[i] != _T('\r') && i < size && buff_pos < 2048) {
+ if(swzText[i] != _T('\t'))
+ buff[buff_pos++] = swzText[i];
i++;
}
- buff[i] = 0;
+ buff[buff_pos] = 0;
- if(_tcslen(buff)) {
+ if(buff_pos) {
pwd->rows = (RowData *)realloc(pwd->rows, sizeof(RowData) * (pwd->row_count + 1));
pwd->rows[pwd->row_count].line_above = false;
pwd->rows[pwd->row_count].value_newline = true;
@@ -150,6 +152,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->row_count++;
top_message = true;
}
+ while(i < size && (swzText[i] == _T('\n') || swzText[i] == _T('\r')))
+ i++;
}
// parse bold bits into labels and the rest into items