mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
kill redundant function prefix_data()
This commit is contained in:
parent
73f3e64bc9
commit
70936ada74
@ -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);
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user