Browse Source

* fix readline history

master
Alex 'AdUser' Z 8 years ago
parent
commit
f19f1e6d8e
  1. 10
      src/client.c

10
src/client.c

@ -113,6 +113,10 @@ readline(const char *prompt) {
} }
return strdup(line); return strdup(line);
} }
/* stubs */
#define add_history(x) (void)(x);
#define using_history()
#endif #endif
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -159,8 +163,12 @@ int main(int argc, char *argv[]) {
exit(ret); exit(ret);
} }
using_history();
while ((line = readline("f2b >> ")) != NULL) { while ((line = readline("f2b >> ")) != NULL) {
handle_cmd(line); if (line[0] != '\n' && line[0] != '\0') {
add_history(line);
handle_cmd(line);
}
free(line); free(line);
line = NULL; line = NULL;
} }

Loading…
Cancel
Save