mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Single loop coloring
This commit is contained in:
parent
078c982f4e
commit
2ae1cca96a
21
src/nnn.c
21
src/nnn.c
|
@ -4105,19 +4105,18 @@ int main(int argc, char *argv[])
|
||||||
if (cfg.showcolor) {
|
if (cfg.showcolor) {
|
||||||
copier = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444");
|
copier = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444");
|
||||||
opt = 0;
|
opt = 0;
|
||||||
while (*copier && opt < CTX_MAX) {
|
while (opt < CTX_MAX) {
|
||||||
if (*copier < '0' || *copier > '7') {
|
if (*copier) {
|
||||||
fprintf(stderr, "invalid color code\n");
|
if (*copier < '0' || *copier > '7') {
|
||||||
return 1;
|
fprintf(stderr, "invalid color code\n");
|
||||||
}
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
g_ctx[opt].color = *copier - '0';
|
g_ctx[opt].color = *copier - '0';
|
||||||
++copier;
|
++copier;
|
||||||
++opt;
|
} else
|
||||||
}
|
g_ctx[opt].color = 4;
|
||||||
|
|
||||||
while (opt != CTX_MAX) {
|
|
||||||
g_ctx[opt].color = 4;
|
|
||||||
++opt;
|
++opt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue