Stop at EOF
This commit is contained in:
parent
b07c06ec9f
commit
f5ba6f19b4
@ -2,6 +2,7 @@
|
||||
using namespace std;
|
||||
|
||||
#include "include/config.h"
|
||||
#include "include/colors.h"
|
||||
|
||||
|
||||
|
||||
@ -12,8 +13,11 @@ string get_input() {
|
||||
int line_num = 0;
|
||||
while (1) {
|
||||
line_num++;
|
||||
printf("%4d ", line_num);
|
||||
getline(cin, buffer);
|
||||
printf(BOLD "%4d " RESET , line_num);
|
||||
if (!getline(cin, buffer)) {
|
||||
cout << "\rReceived EOF" << endl;
|
||||
exit(0);
|
||||
}
|
||||
input += "\n" + buffer;
|
||||
|
||||
int n = input.length();
|
||||
|
Loading…
Reference in New Issue
Block a user