Espresso 0.0.1b

This commit is contained in:
2025-06-27 14:48:06 -05:00
parent fca025a9bf
commit c336584114
39 changed files with 2676 additions and 936 deletions

View File

@ -79,7 +79,7 @@ static void append_char(char c)
{
if (current_length + 1 >= capacity)
{
/* Need more space (+1 for '\0') */
/* Need more space (+1 for the null zero) */
int new_capacity = (capacity == 0) ? 16 : capacity * 2;
char* new_str = (char*)malloc(new_capacity);
@ -92,6 +92,11 @@ static void append_char(char c)
memcpy(new_str, current_string, current_length);
free(current_string);
}
if (!current_string)
{
return;
}
current_string = new_str;
capacity = new_capacity;
@ -147,6 +152,12 @@ void keyboard_handler(void) {
{
c = (char) terminal_get_shifted((unsigned char) c);
}
if (scancode == 0x1C) {
printf("\n");
return;
}
if (c)
{
@ -164,3 +175,4 @@ void keyboard_handler(void) {
}
}
}