diff --git a/src/main.c b/src/main.c index c9b4235..d4bce3c 100644 --- a/src/main.c +++ b/src/main.c @@ -11,15 +11,16 @@ MSH_ENTRY_POINT { while (1) { int out; - char *buf = msh_callocate(2048, sizeof(char)); + char *buf = msh_callocate(512, sizeof(char)); int i = 0, n = 0, last = 0; SIZE_TYPE sz = 0, leftoff = 0; msh_print_strings(msh_working_directory(), " %> ", 0); - while ((out = msh_read_input(buf, &sz, 2048)), out != -1) { + while ((out = msh_read_input(buf, &sz, 512)), out != -1) { switch (out) { - /* backspace */ + /* backspace (also do this when we run out of space) */ + case -2: case 0x7F: if (sz > 0) { msh_move_cursor(-1);