浏览代码

Fix issues with DEL on Mac on empty regex exprn

On Mac and error is thrown if the regex expression to regcomp() is empty.

Please refer to comments at:
c42df81ae5
master
Arun Prakash Jana 8 年前
父节点
当前提交
249b6f76fc
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      nnn.c

+ 4
- 2
nnn.c 查看文件

@@ -475,7 +475,7 @@ setfilter(regex_t *regex, char *filter)
static int r;

r = regcomp(regex, filter, REG_NOSUB | REG_EXTENDED | REG_ICASE);
if (r != 0) {
if (r != 0 && filter && filter[0] != '\0') {
len = COLS;
if (len > LINE_MAX)
len = LINE_MAX;
@@ -738,8 +738,10 @@ readln(char *path)
wln[--len] = '\0';
wcstombs(ln, wln, LINE_MAX << 2);
ndents = total;
if (matches(pln) == -1)
if (matches(pln) == -1) {
printprompt(ln);
continue;
}
redraw(path);
printprompt(ln);
break;


正在加载...
取消
保存