1
0
Fork 0

(svn r280) -Fix: ^M removement in console.c

release/0.4.5
signde 2004-09-17 09:51:44 +00:00
parent 7693c58e28
commit f7cfd47261
1 changed files with 34 additions and 34 deletions

View File

@ -7,10 +7,10 @@
#include "variables.h" #include "variables.h"
#include "hal.h" #include "hal.h"
#include <stdarg.h> #include <stdarg.h>
#include "console.h" #include "console.h"
#ifdef WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
#endif #endif
// ** main console ** // // ** main console ** //
@ -50,31 +50,31 @@ static const WindowDesc _iconsole_window_desc = {
/* *************** */ /* *************** */
/* end of header */ /* end of header */
/* *************** */ /* *************** */
static void IConsoleAppendClipboard() static void IConsoleAppendClipboard()
{ {
#ifdef WIN32 #ifdef WIN32
if (IsClipboardFormatAvailable(CF_TEXT)) { if (IsClipboardFormatAvailable(CF_TEXT)) {
byte * data; byte * data;
HGLOBAL cbuf; HGLOBAL cbuf;
int i; int i;
OpenClipboard(NULL); OpenClipboard(NULL);
cbuf = GetClipboardData(CF_TEXT); cbuf = GetClipboardData(CF_TEXT);
data = (byte *) GlobalLock(cbuf); data = (byte *) GlobalLock(cbuf);
i=0; i=0;
while (IS_INT_INSIDE(data[i], 32, 256)) { while (IS_INT_INSIDE(data[i], 32, 256)) {
_iconsole_cmdline[_iconsole_cmdpos]=data[i]; _iconsole_cmdline[_iconsole_cmdpos]=data[i];
i++; i++;
_iconsole_cmdpos++; _iconsole_cmdpos++;
} }
GlobalUnlock(cbuf); GlobalUnlock(cbuf);
CloseClipboard(); CloseClipboard();
} }
#endif #endif
} }
static void IConsoleClearCommand() static void IConsoleClearCommand()
@ -132,11 +132,11 @@ static void IConsoleWndProc(Window *w, WindowEvent *e)
break; break;
case WE_KEYPRESS: case WE_KEYPRESS:
e->keypress.cont=false; e->keypress.cont=false;
if (e->keypress.keycode == (WKC_CTRL | 'V')) if (e->keypress.keycode == (WKC_CTRL | 'V'))
{ {
IConsoleAppendClipboard(); IConsoleAppendClipboard();
SetWindowDirty(w); SetWindowDirty(w);
} else } else
if (e->keypress.keycode == (WKC_UP)) if (e->keypress.keycode == (WKC_UP))
{ {