Allow input of utf8 characters
This commit is contained in:
parent
16cb1823c4
commit
8d49821fdd
15
src/modal.c
15
src/modal.c
|
@ -90,14 +90,6 @@ device_write(char *s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
device_read(void)
|
|
||||||
{
|
|
||||||
char c, *origin = dst_;
|
|
||||||
while(fread(&c, 1, 1, stdin) && c >= ' ') *dst_++ = c;
|
|
||||||
if(feof(stdin)) dst_ = copy("EOF", dst_, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
file_import(char *path, char *ptr)
|
file_import(char *path, char *ptr)
|
||||||
{
|
{
|
||||||
|
@ -123,7 +115,12 @@ write_reg(char r, char *reg)
|
||||||
{
|
{
|
||||||
switch(r) {
|
switch(r) {
|
||||||
case ':': device_write(reg); return;
|
case ':': device_write(reg); return;
|
||||||
case '~': device_read(); return;
|
case '~': {
|
||||||
|
unsigned char c;
|
||||||
|
while(fread(&c, 1, 1, stdin) && c >= ' ') *dst_++ = c;
|
||||||
|
if(feof(stdin)) dst_ = copy("EOF", dst_, 3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
case '_': {
|
case '_': {
|
||||||
char filepath[0x80];
|
char filepath[0x80];
|
||||||
copy(reg, filepath, walk(reg) - reg);
|
copy(reg, filepath, walk(reg) - reg);
|
||||||
|
|
Loading…
Reference in New Issue