Browse Source

* client readline improve

master
Alex 'AdUser' Z 9 years ago
parent
commit
5af6ac287c
  1. 7
      src/client.c

7
src/client.c

@ -128,11 +128,16 @@ int main(int argc, char *argv[]) {
while (1) { while (1) {
fputs("f2b >> ", stdout); fputs("f2b >> ", stdout);
fgets(line, sizeof(line) - 1, stdin); if (!fgets(line, sizeof(line) - 1, stdin)) {
if (feof(stdin)) { if (feof(stdin)) {
fputc('\n', stdout); fputc('\n', stdout);
} else {
fputs("read error\n", stdout);
}
break; break;
} }
if (line[0] == '\n')
continue;
handle_cmd(line); handle_cmd(line);
} }

Loading…
Cancel
Save