Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4238 → Rev 4239

/trunk/uspace/app/bdsh/input.c
34,6 → 34,8
#include <string.h>
#include <io/stream.h>
#include <console.h>
#include <kbd/kbd.h>
#include <kbd/keycode.h>
 
#include "config.h"
#include "util.h"
96,17 → 98,20
 
static void read_line(char *buffer, int n)
{
char c;
kbd_event_t ev;
int chars;
 
chars = 0;
while (chars < n - 1) {
c = getchar();
if (c < 0)
fflush(stdout);
if (kbd_get_event(&ev) < 0)
return;
if (c == '\n')
if (ev.type == KE_RELEASE)
continue;
 
if (ev.key == KC_ENTER || ev.key == KC_NENTER)
break;
if (c == '\b') {
if (ev.key == KC_BACKSPACE) {
if (chars > 0) {
putchar('\b');
--chars;
113,9 → 118,10
}
continue;
}
if (c >= ' ') {
putchar(c);
buffer[chars++] = c;
if (ev.c >= ' ') {
//putchar(ev.c);
console_putchar(ev.c);
buffer[chars++] = ev.c;
}
}
putchar('\n');
/trunk/uspace/app/tester/print/print4.c
81,6 → 81,8
printf("Arabic: %ls\n", L"التوزيع الجغرافي للحمل العنقودي");
printf("Russian: %ls\n", L"Леннон познакомился с художницей-авангардисткой");
printf("Armenian: %ls\n", L"Սկսեց հրատարակվել Երուսաղեմի հայկական");
 
printf("Test: [%d] '%lc'\n", L'\x0161', L'\x0161');
}
 
printf("[Press a key]\n");