kill redundant function prefix_data()

This commit is contained in:
nick black 2021-12-19 03:50:40 -05:00
parent 73f3e64bc9
commit 70936ada74
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 1 additions and 16 deletions

View File

@ -507,7 +507,7 @@ int main(int argc, const char** argv){
tinfo_debug_styles(nc, stdn, indent);
tinfo_debug_bitmaps(stdn, &nc->tcache, indent);
unicodedumper(stdn, indent);
char* path = prefix_data("notcurses.png");
char* path = notcurses_data_path(NULL, "notcurses.png");
if(path){
display_logo(stdn, path); // let it fail
free(path);

View File

@ -1818,21 +1818,6 @@ typedef struct ncvisual_implementation {
// populated by libnotcurses.so if linked with multimedia
API extern ncvisual_implementation* visual_implementation;
// prepend base with the Notcurses data directory as configured.
static inline char*
prefix_data(const char* base){
// need a byte for each of directory separator and nul terminator
const size_t dlen = strlen(NOTCURSES_SHARE);
size_t len = dlen + strlen(base) + 2;
char* path = (char*)malloc(len); // cast for C++ includers
if(path){
memcpy(path, NOTCURSES_SHARE, dlen);
path[dlen] = path_separator();
strcpy(path + dlen + 1, base);
}
return path;
}
// within unix, we can just use isatty(3). on windows, things work
// differently. for a true Windows Terminal, we'll have HANDLE pointers
// rather than file descriptors. in cygwin/msys2, isatty(3) always fails.