Stop at EOF

This commit is contained in:
augustin64 2023-11-11 09:05:57 +01:00
parent b07c06ec9f
commit f5ba6f19b4

View File

@ -2,6 +2,7 @@
using namespace std; using namespace std;
#include "include/config.h" #include "include/config.h"
#include "include/colors.h"
@ -12,8 +13,11 @@ string get_input() {
int line_num = 0; int line_num = 0;
while (1) { while (1) {
line_num++; line_num++;
printf("%4d ", line_num); printf(BOLD "%4d " RESET , line_num);
getline(cin, buffer); if (!getline(cin, buffer)) {
cout << "\rReceived EOF" << endl;
exit(0);
}
input += "\n" + buffer; input += "\n" + buffer;
int n = input.length(); int n = input.length();