We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 702d2a6 commit 599434aCopy full SHA for 599434a
1 file changed
src/third-party/notcurses/src/lib/terminfo.c
@@ -13,6 +13,14 @@
13
const char*
14
terminfo_find_path_for_term(const char* term_name)
15
{
16
+ static const char* DEFAULT_DIRS[] = {
17
+ "/usr/share/terminfo/",
18
+ "/lib/terminfo/",
19
+ "/usr/lib/terminfo/",
20
+ "/etc/terminfo/",
21
+ NULL,
22
+ };
23
+
24
if (!term_name || !term_name[0]) {
25
return NULL;
26
}
@@ -53,6 +61,18 @@ terminfo_find_path_for_term(const char* term_name)
53
61
dirs = next_colon + 1;
54
62
55
63
64
+ for (int lpc = 0; DEFAULT_DIRS[lpc]; lpc++) {
65
+ snprintf(path,
66
+ sizeof(path),
67
+ "%s/%02x/%s",
68
+ DEFAULT_DIRS[lpc],
69
+ term_name[0],
70
+ term_name);
71
+ if (access(path, R_OK) == 0) {
72
+ return strdup(path);
73
+ }
74
75
56
76
57
77
58
78
0 commit comments