fix: delete commented code
This commit is contained in:
parent
ec3fc81544
commit
a3d156eb1f
1 changed files with 0 additions and 31 deletions
31
src/main.c
31
src/main.c
|
@ -4,13 +4,6 @@
|
|||
#include "reader.h"
|
||||
|
||||
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;
|
||||
|
||||
while (1) {
|
||||
|
@ -23,29 +16,5 @@ int main() {
|
|||
printf("command: '%s'\n", 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);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue