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) {
|
||||
copier = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444");
|
||||
opt = 0;
|
||||
while (*copier && opt < CTX_MAX) {
|
||||
if (*copier < '0' || *copier > '7') {
|
||||
fprintf(stderr, "invalid color code\n");
|
||||
return 1;
|
||||
}
|
||||
while (opt < CTX_MAX) {
|
||||
if (*copier) {
|
||||
if (*copier < '0' || *copier > '7') {
|
||||
fprintf(stderr, "invalid color code\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_ctx[opt].color = *copier - '0';
|
||||
++copier;
|
||||
++opt;
|
||||
}
|
||||
g_ctx[opt].color = *copier - '0';
|
||||
++copier;
|
||||
} else
|
||||
g_ctx[opt].color = 4;
|
||||
|
||||
while (opt != CTX_MAX) {
|
||||
g_ctx[opt].color = 4;
|
||||
++opt;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue