Single loop coloring

This commit is contained in:
Arun Prakash Jana 2019-02-23 08:51:21 +05:30
parent 078c982f4e
commit 2ae1cca96a
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -4105,7 +4105,8 @@ 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) {
if (*copier < '0' || *copier > '7') { if (*copier < '0' || *copier > '7') {
fprintf(stderr, "invalid color code\n"); fprintf(stderr, "invalid color code\n");
return 1; return 1;
@ -4113,11 +4114,9 @@ int main(int argc, char *argv[])
g_ctx[opt].color = *copier - '0'; g_ctx[opt].color = *copier - '0';
++copier; ++copier;
++opt; } else
}
while (opt != CTX_MAX) {
g_ctx[opt].color = 4; g_ctx[opt].color = 4;
++opt; ++opt;
} }
} }