various fixes

This commit is contained in:
Alexander S. Aganichev
2001-01-28 15:13:00 +00:00
parent d288f34470
commit 9f70f9735c
11 changed files with 130 additions and 52 deletions

View File

@@ -125,7 +125,7 @@ char* gclipbrd::read(char* buffer, int maxlen) {
if(len > i and strchr("\r\n", *(p+1)) and (*p != *(p+1)))
++i;
}
strxcpy(buffer, clipdata, ++i);
strxcpy(buffer, clipdata, i+1);
char* p2 = strpbrk(buffer, "\r\n");
if(p2) *p2 = 0;
if(p) strcat(buffer, "\n");

View File

@@ -575,12 +575,12 @@ void GVid::detectinfo(GVidInfo* _info) {
assert(GetConsoleScreenBufferInfo(gvid_hout, &csbi) != 0);
_info->screen.mode = 0;
_info->screen.rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
_info->screen.columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
_info->screen.rows = csbi.dwSize.Y;
_info->screen.columns = csbi.dwSize.X;
// Get cursor position and character attribute under the cursor
_info->cursor.row = csbi.dwCursorPosition.Y - csbi.srWindow.Top;
_info->cursor.column = csbi.dwCursorPosition.X - csbi.srWindow.Left;
_info->cursor.row = csbi.dwCursorPosition.Y;
_info->cursor.column = csbi.dwCursorPosition.X;
_info->color.textattr = csbi.wAttributes;
// Get cursor form

View File

@@ -63,20 +63,18 @@ void _HudsWide<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::update_netecho
// Delete or add the header index
if(__delete) {
if(_pos < _total) {
memmove(_scanidx+_pos, _scanidx+_pos+1, (_total-_pos-1)*sizeof(msgn_t));
_total--;
--_total;
if(_total != _pos)
memmove(_scanidx+_pos, _scanidx+_pos+1, (_total-_pos)*sizeof(msgn_t));
}
}
else {
if(_scanidx[_closest] != __hdridx) {
_scanidx[_total++] = __hdridx;
for(uint k=_total >> 1; k; k >>= 1)
for(uint i=k; i < _total; i++)
for(uint j=i-k; (j >= 0) and CmpV(_scanidx[j], _scanidx[j+k]) > 0; j-=k) {
msgn_t e = _scanidx[j];
_scanidx[j] = _scanidx[j+k];
_scanidx[j+k] = e;
}
++_closest;
if(_closest != _total)
memmove(_scanidx+_closest+1, _scanidx+_closest, (_total-_closest+1)*sizeof(msgn_t));
_scanidx[_closest] = __hdridx;
++_total;
}
}