fix: delete commented code

This commit is contained in:
Ahurac 2024-09-30 10:28:21 +02:00
parent ec3fc81544
commit a3d156eb1f

View file

@ -4,13 +4,6 @@
#include "reader.h" #include "reader.h"
int main() { int main() {
/*
size_t buffer_size;
size_t initial_buffer_size = 64;
char *input_buffer;
char *initial_buffer_position;
unsigned int how_many_characters_to_read;
*/
char *input_line; char *input_line;
while (1) { while (1) {
@ -23,29 +16,5 @@ int main() {
printf("command: '%s'\n", input_line); printf("command: '%s'\n", input_line);
free(input_line); free(input_line);
/*
buffer_size = initial_buffer_size;
how_many_characters_to_read = buffer_size + 1;
input_buffer = malloc(how_many_characters_to_read);
initial_buffer_position = input_buffer;
printf("shell> ");
while (fgets(input_buffer, how_many_characters_to_read, stdin) != NULL &&
input_buffer[strlen(input_buffer) - 1] != '\n') {
size_t new_buffer_size = buffer_size * 2;
if (buffer_size != initial_buffer_size) {
how_many_characters_to_read = buffer_size + 1;
}
input_buffer = realloc(initial_buffer_position, new_buffer_size + 1);
initial_buffer_position = input_buffer;
input_buffer += buffer_size;
buffer_size = new_buffer_size;
}
input_buffer = initial_buffer_position;
printf("%s", input_buffer);
free(input_buffer);
*/
} }
} }