diff options
| author | 2017-06-04 23:58:30 +0530 | |
|---|---|---|
| committer | 2017-06-04 23:58:30 +0530 | |
| commit | 249b6f76fcc06892fa96c0972a03568ad1a26ea8 (patch) | |
| tree | a22b41b07c6ac8fded86415aa4280eea79f7dbe7 | |
| parent | 9b6446a0be27323c35d0750313ad8ac9d783aa7e (diff) | |
| download | nnn-249b6f76fcc06892fa96c0972a03568ad1a26ea8.tar.gz | |
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:
https://github.com/jarun/nnn/commit/c42df81ae5f1206ee586d4e2f236c77f1f0dfbbe
| -rw-r--r-- | nnn.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |