X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=ac22ae039dde7a15f739a6d9c67ff9be60eee518;hb=4f08537e2d1c8c361d08e07a2d67cd3f53e03f40;hp=c907d123df56c0fdfae53662c8e09c1962260229;hpb=ad3b097c9e587c1474cc1cac93f89ada853902ff;p=open-adventure.git diff --git a/misc.c b/misc.c index c907d12..ac22ae0 100644 --- a/misc.c +++ b/misc.c @@ -295,7 +295,7 @@ void rspeak(vocab_t i, ...) va_end(ap); } -void echo_input(FILE* destination, char* input_prompt, char* input) +void echo_input(FILE* destination, const char* input_prompt, const char* input) { size_t len = strlen(input_prompt) + strlen(input) + 1; char* prompt_and_input = (char*) xmalloc(len); @@ -354,7 +354,7 @@ char* get_input() echo_input(stdout, input_prompt, input); if (logfp) - echo_input(logfp, input_prompt, input); + echo_input(logfp, "", input); return (input); } @@ -459,7 +459,7 @@ int get_motion_vocab_id(const char* word) { for (int i = 0; i < NMOTIONS; ++i) { for (int j = 0; j < motions[i].words.n; ++j) { - if (strcasecmp(word, motions[i].words.strs[j]) == 0) + if (strcasecmp(word, motions[i].words.strs[j]) == 0 && (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !oldstyle)) return (i); } } @@ -485,7 +485,7 @@ int get_action_vocab_id(const char* word) { for (int i = 0; i < NACTIONS; ++i) { for (int j = 0; j < actions[i].words.n; ++j) { - if (strcasecmp(word, actions[i].words.strs[j]) == 0) + if (strcasecmp(word, actions[i].words.strs[j]) == 0 && (strlen(word) > 1 || strchr(ignore, word[0]) == NULL || !oldstyle)) return (i); } }