mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
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
This commit is contained in:
parent
9b6446a0be
commit
249b6f76fc
6
nnn.c
6
nnn.c
|
@ -475,7 +475,7 @@ setfilter(regex_t *regex, char *filter)
|
||||||
static int r;
|
static int r;
|
||||||
|
|
||||||
r = regcomp(regex, filter, REG_NOSUB | REG_EXTENDED | REG_ICASE);
|
r = regcomp(regex, filter, REG_NOSUB | REG_EXTENDED | REG_ICASE);
|
||||||
if (r != 0) {
|
if (r != 0 && filter && filter[0] != '\0') {
|
||||||
len = COLS;
|
len = COLS;
|
||||||
if (len > LINE_MAX)
|
if (len > LINE_MAX)
|
||||||
len = LINE_MAX;
|
len = LINE_MAX;
|
||||||
|
@ -738,8 +738,10 @@ readln(char *path)
|
||||||
wln[--len] = '\0';
|
wln[--len] = '\0';
|
||||||
wcstombs(ln, wln, LINE_MAX << 2);
|
wcstombs(ln, wln, LINE_MAX << 2);
|
||||||
ndents = total;
|
ndents = total;
|
||||||
if (matches(pln) == -1)
|
if (matches(pln) == -1) {
|
||||||
|
printprompt(ln);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
redraw(path);
|
redraw(path);
|
||||||
printprompt(ln);
|
printprompt(ln);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue