X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=df6f9aa7dfa2ba5054b40cf3c5cd6a483971c575;hb=dec4cf3968b2b4187e9259204fa9a0bbc20831f9;hp=84eca5758177d5d262d015186fb02bb5e3aeb80b;hpb=45820bc8cd6e01279d94703fd18b73f6848f09aa;p=open-adventure.git diff --git a/main.c b/main.c index 84eca57..df6f9aa 100644 --- a/main.c +++ b/main.c @@ -21,14 +21,12 @@ #include #include #include "advent.h" -#include "linenoise/linenoise.h" #include "dungeon.h" #define DIM(a) (sizeof(a)/sizeof(a[0])) FILE *logfp = NULL, *rfp = NULL; bool oldstyle = false; -bool editline = true; bool prompt = true; // LCOV_EXCL_START @@ -64,11 +62,11 @@ int main(int argc, char *argv[]) /* Options. */ #ifndef ADVENT_NOSAVE - const char* opts = "l:or:s"; - const char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename] [-s] \n"; + const char* opts = "l:or"; + const char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename]\n"; #else - const char* opts = "l:os"; - const char* usage = "Usage: %s [-l logfilename] [-o] [-s] \n"; + const char* opts = "l:o"; + const char* usage = "Usage: %s [-l logfilename] [-o]\n"; #endif while ((ch = getopt(argc, argv, opts)) != EOF) { switch (ch) { @@ -82,7 +80,7 @@ int main(int argc, char *argv[]) break; case 'o': oldstyle = true; - editline = prompt = false; + prompt = false; break; #ifndef ADVENT_NOSAVE case 'r': @@ -94,9 +92,6 @@ int main(int argc, char *argv[]) signal(SIGINT, sig_handler); break; #endif - case 's': - editline = false; - break; default: fprintf(stderr, usage, argv[0]); @@ -108,15 +103,11 @@ int main(int argc, char *argv[]) fprintf(stderr, " -r restore from specified saved game file\n"); #endif - fprintf(stderr, - " -s suppress command editing\n"); exit(EXIT_FAILURE); break; } } - linenoiseHistorySetMaxLen(350); - /* Initialize game variables */ long seedval = initialise(); @@ -1036,7 +1027,7 @@ L2600: } strncpy(inputbuf, input, LINESIZE - 1); - linenoiseFree(input); + free(input); long tokens[4]; tokenize(inputbuf, tokens);