瀏覽代碼

Detect odd hex symbols in NNN_COLORS

master
Arun Prakash Jana 4 年之前
父節點
當前提交
ccfccb7187
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: A75979F35C080412
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. +10
    -10
      src/nnn.c

+ 10
- 10
src/nnn.c 查看文件

@@ -1589,7 +1589,6 @@ static bool initcurses(void *oldmask)


if (colors || !getenv("NO_COLOR")) { if (colors || !getenv("NO_COLOR")) {
uint *pcode; uint *pcode;
char ch;
bool ext = FALSE; bool ext = FALSE;


start_color(); start_color();
@@ -1622,16 +1621,17 @@ static bool initcurses(void *oldmask)


if (colors && *colors) { if (colors && *colors) {
if (ext) { if (ext) {
ch = *colors; *pcode = xchartohex(*colors) << 4;
if (*++colors) { if (*++colors)
*pcode = (16 * xchartohex(ch)) + xchartohex(*colors); *pcode += xchartohex(*colors);
++colors; else { /* Each color code must be 2 hex symbols */
} else exitcurses();
*pcode = xchartohex(ch); fprintf(stderr, "NNN_COLORS!\n");
} else { return FALSE;
}
} else
*pcode = (*colors < '0' || *colors > '7') ? 4 : *colors - '0'; *pcode = (*colors < '0' || *colors > '7') ? 4 : *colors - '0';
++colors; ++colors;
}
} else } else
*pcode = 4; *pcode = 4;




||||||
x
 
000:0
Loading…
取消
儲存