From 75bd0dd0bcb406b651d681b762e5294323bda0c6 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 29 Nov 2021 22:19:45 -0500 Subject: [PATCH] use notcurses_data_dir() in tester, fetch --- CMakeLists.txt | 6 +++--- src/fetch/main.c | 3 ++- src/lib/in.c | 6 +----- src/tests/main.cpp | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a665d97d4..54ae04441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,7 @@ endif() feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) -file(GLOB COMPATSRC CONFIGURE_DEPENDS src/compat/compat.c) +file(GLOB COMPATSRC CONFIGURE_DEPENDS src/compat/*.c) ############################################################################ # libnotcurses-core (core shared library, core static library) @@ -625,7 +625,7 @@ endif() ############################################################################ # ncneofetch -file(GLOB FETCHSRCS CONFIGURE_DEPENDS src/fetch/*.c) +file(GLOB FETCHSRCS CONFIGURE_DEPENDS src/fetch/*.c src/compat/*.c) add_executable(ncneofetch ${FETCHSRCS} ${COMPATSRC}) target_include_directories(ncneofetch BEFORE @@ -694,7 +694,7 @@ if(${BUILD_TESTING}) if(${USE_CPP}) #set(CMAKE_CTEST_ARGUMENTS "-V") if(${USE_DOCTEST}) -file(GLOB TESTSRCS CONFIGURE_DEPENDS src/tests/*.cpp) +file(GLOB TESTSRCS CONFIGURE_DEPENDS src/tests/*.cpp src/compat/*.c) add_executable(notcurses-tester ${TESTSRCS}) target_include_directories(notcurses-tester BEFORE diff --git a/src/fetch/main.c b/src/fetch/main.c index 3a54b3b8d..d50aef25f 100644 --- a/src/fetch/main.c +++ b/src/fetch/main.c @@ -28,12 +28,13 @@ static inline char* find_data(const char* datum){ - const char* datadir = NOTCURSES_SHARE; + char* datadir = notcurses_data_dir(); const size_t dlen = strlen(datadir); char* path = malloc(dlen + 1 + strlen(datum) + 1); strcpy(path, datadir); path[dlen] = path_separator(); strcpy(path + dlen + 1, datum); + free(datadir); return path; } diff --git a/src/lib/in.c b/src/lib/in.c index c5492efc7..7e8da3221 100644 --- a/src/lib/in.c +++ b/src/lib/in.c @@ -1398,13 +1398,9 @@ build_cflow_automaton(inputctx* ictx){ { "[\\N;\\N:\\Nu", kitty_cb_complex, }, { "[\\N;\\N;\\N~", xtmodkey_cb, }, { "[\\N;\\N:\\N~", kitty_cb_functional, }, - /* { "[1;\\NP", legacy_cb_f1, }, - */ { "[1;\\NQ", legacy_cb_f2, }, - /* - { "[1;\\NR", legacy_cb_f3, }, - */ + //{ "[1;\\NR", legacy_cb_f3, }, { "[1;\\NS", legacy_cb_f4, }, { "[1;\\ND", legacy_cb_left, }, { "[1;\\NC", legacy_cb_right, }, diff --git a/src/tests/main.cpp b/src/tests/main.cpp index a86a28b3e..a32ee8de8 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -8,7 +8,7 @@ #include #include -const char* datadir = NOTCURSES_SHARE; +const char* datadir = notcurses_data_dir(); // NCLOGLEVEL_INFO for initial testing framework creation. we then switch to // command line-specified loglevel, _SILENT if none specified. ncloglevel_e cliloglevel = NCLOGLEVEL_INFO;