mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Code refactor
This commit is contained in:
parent
05e910deb0
commit
867266431f
12
src/nnn.c
12
src/nnn.c
|
@ -3677,8 +3677,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* Get the context colors; copier used as tmp var */
|
/* Get the context colors; copier used as tmp var */
|
||||||
if (cfg.showcolor) {
|
if (cfg.showcolor) {
|
||||||
copier = getenv("NNN_CONTEXT_COLORS");
|
copier = xgetenv("NNN_CONTEXT_COLORS", "4444");
|
||||||
if (copier) {
|
|
||||||
opt = 0;
|
opt = 0;
|
||||||
while (*copier && opt < CTX_MAX) {
|
while (*copier && opt < CTX_MAX) {
|
||||||
if (*copier < '0' || *copier > '7') {
|
if (*copier < '0' || *copier > '7') {
|
||||||
|
@ -3695,14 +3694,11 @@ int main(int argc, char *argv[])
|
||||||
g_ctx[opt].color = 4;
|
g_ctx[opt].color = 4;
|
||||||
++opt;
|
++opt;
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
for (opt = 0; opt < CTX_MAX; ++opt)
|
|
||||||
g_ctx[opt].color = 4; /* Default color is blue */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse bookmarks string */
|
/* Parse bookmarks string */
|
||||||
if (!parsebmstr()) {
|
if (!parsebmstr()) {
|
||||||
fprintf(stderr, "NNN_BMS: single-char keys only\n");
|
fprintf(stderr, "NNN_BMS: 1 char per key\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3766,9 +3762,7 @@ int main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Get custom opener, if set */
|
/* Get custom opener, if set */
|
||||||
opener = getenv("NNN_OPENER");
|
opener = xgetenv("NNN_OPENER", utils[OPENER]);
|
||||||
if (!opener)
|
|
||||||
opener = utils[OPENER];
|
|
||||||
|
|
||||||
/* Get locker wait time, if set; copier used as tmp var */
|
/* Get locker wait time, if set; copier used as tmp var */
|
||||||
copier = getenv("NNN_IDLE_TIMEOUT");
|
copier = getenv("NNN_IDLE_TIMEOUT");
|
||||||
|
|
Loading…
Reference in a new issue