diff --git a/programs/cmm/browser/TWB/special.h b/programs/cmm/browser/TWB/special.h index 156923085..9dae6612b 100644 --- a/programs/cmm/browser/TWB/special.h +++ b/programs/cmm/browser/TWB/special.h @@ -66,6 +66,7 @@ char *unicode_symbols[]={ "lowast","*", "#128154","<3", +"#128545",":(", 0}; diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 2a43dc97d..83022c6b0 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -199,7 +199,7 @@ void main() GetProcessInfo(#Form, SelfInfo); ProcessMenuClick(); sc.get(); - if (Form.status_window>2) break; + if (Form.status_window & ROLLED_UP) break; if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; } if (Form.width<280) { MoveSize(OLD,OLD,280,OLD); break; } draw_window(); @@ -870,7 +870,7 @@ void DrawStatusBar(dword _msg) { dword status_y = Form.cheight - STATUSBAR_H + 4; dword status_w = Form.cwidth - 90; - if (Form.status_window>2) return; + if (Form.status_window & ROLLED_UP) return; DrawBar(0,Form.cheight - STATUSBAR_H+1, Form.cwidth,STATUSBAR_H-1, sc.work); if (_msg) { ESI = math.min(status_w/6, strlen(_msg)); diff --git a/programs/cmm/browser/const.h b/programs/cmm/browser/const.h index f6b155a59..8843bed40 100644 --- a/programs/cmm/browser/const.h +++ b/programs/cmm/browser/const.h @@ -112,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw"; #define DEFAULT_URL URL_SERVICE_HOMEPAGE -char version[]="WebView 3.82"; \ No newline at end of file +char version[]="WebView 3.83"; \ No newline at end of file diff --git a/programs/cmm/lib/collection.h b/programs/cmm/lib/collection.h index d9699f237..7b1c16238 100644 --- a/programs/cmm/lib/collection.h +++ b/programs/cmm/lib/collection.h @@ -26,15 +26,9 @@ struct collection_int :void collection_int::add(dword _in) { unsigned i; - if (!buf) { - //if (buf_size) notify("'buf_size on empty buf' -A"); - buf_size = 4096 * 5; - buf = malloc(4096 * 5); - //if (!buf) notify("'malloc error' -E"); - } else if (count + 1 * DWSIZE4 >= buf_size) { + if (!buf) || (count + 1 * DWSIZE4 >= buf_size) { buf_size += 4096 * 5; buf = realloc(buf, buf_size); - //if (!buf) notify("'realloc error' -E"); } i = count * DWSIZE4 + buf; ESDWORD[i] = _in; @@ -77,8 +71,8 @@ struct collection_int :void collection_int::drop() { count = 0; - if (buf) buf = free(buf); - buf_size = 0; + //if (buf) buf = free(buf); + //buf_size = 0; } /*======================================================== @@ -97,31 +91,30 @@ struct collection dword get(); //get_name_by_pos dword get_pos_by_name(); void drop(); - void increase_data_size(); dword get_last(); bool pop(); }; -:void collection::increase_data_size() { - if (realloc_size<4096) realloc_size = 4096; - if (!data_size) { - data_size = realloc_size; - data_start = malloc(data_size); - } else { - data_size = data_size + realloc_size; - data_start = realloc(data_start, data_size); - } -} - :dword collection::add(dword in) { dword len = strlen(in); - while (offset.get(count) + len + 4 > data_size) { - increase_data_size(); + unsigned cur_buf_size; + + if (!count) { + cur_buf_size = 0; + } else { + cur_buf_size = offset.get(count); } - strncpy(data_start+offset.get(count), in, len); + + if (realloc_size<4096) realloc_size = 4096; + while (cur_buf_size + len + 4 > data_size) { + data_size += realloc_size; + data_start = realloc(data_start, data_size); + } + + strncpy(data_start+cur_buf_size, in, len); count++; - offset.set(count, offset.get(count-1) + len + 1); - return data_start+offset.get(count-1); + offset.set(count, cur_buf_size + len + 1); + return data_start + cur_buf_size; } :dword collection::get(dword pos) {