From c6cf6be320717d6f53628ef3e5a59c0fdc6cd358 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 24 Apr 2022 17:48:19 +0200 Subject: [PATCH] Use Windows-compatible linenoise --- .gitmodules | 2 +- deps/linenoise | 2 +- src/CMakeLists.txt | 4 +++- src/client/client_auth.c | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6ced1b8..6404413 100644 --- a/.gitmodules +++ b/.gitmodules @@ -21,7 +21,7 @@ url = https://github.com/dragonblocks/dragonnet [submodule "deps/linenoise"] path = deps/linenoise - url = https://github.com/antirez/linenoise + url = https://github.com/msteveb/linenoise [submodule "deps/protogen"] path = deps/protogen url = https://github.com/dragonblocks/protogen diff --git a/deps/linenoise b/deps/linenoise index 97d2850..9430e6e 160000 --- a/deps/linenoise +++ b/deps/linenoise @@ -1 +1 @@ -Subproject commit 97d2850af13c339369093b78abe5265845d78220 +Subproject commit 9430e6e4e7fc09e8ca6a2fd5e3fcafa07818542e diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb61231..44f3094 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,7 @@ endif() add_compile_definitions("USE_DRAGONNET") add_compile_definitions("RESSOURCE_PATH=\"${RESSOURCE_PATH}\"") -add_compile_options(-Wall -Wextra -Werror -Wno-address-of-packed-member -fmax-errors=4) +add_compile_options(-Wall -Wextra -Werror -Wno-address-of-packed-member -Wno-implicit-fallthrough -fmax-errors=4) link_libraries( pthread @@ -73,6 +73,8 @@ set(COMMON_SOURCES "${DEPS_DIR}/dragonstd/tree.c" "${DEPS_DIR}/dragonstd/bits/compare.c" "${DEPS_DIR}/linenoise/linenoise.c" + "${DEPS_DIR}/linenoise/stringbuf.c" + "${DEPS_DIR}/linenoise/utf8.c" "${DEPS_DIR}/perlin/perlin.c" color.c config.c diff --git a/src/client/client_auth.c b/src/client/client_auth.c index afa3ebd..b955cd5 100644 --- a/src/client/client_auth.c +++ b/src/client/client_auth.c @@ -15,7 +15,7 @@ static void auth_loop() while (!interrupt.set) switch (client_auth.state) { case AUTH_INIT: if (client_auth.name) - linenoiseFree(client_auth.name); + free(client_auth.name); if (!(client_auth.name = linenoise("Enter name: "))) return; @@ -64,5 +64,5 @@ void client_auth_deinit() { pthread_cond_destroy(&client_auth.cv); pthread_mutex_destroy(&client_auth.mtx); - linenoiseFree(client_auth.name); + free(client_auth.name); } -- 2.44.0