mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Force accurate regex match
This commit is contained in:
parent
7d672411bb
commit
5fa16dbd15
2
nnn.1
2
nnn.1
|
@ -457,7 +457,7 @@ separated by \fI;\fR:
|
|||
.Pp
|
||||
\fBNNN_ARCHIVE:\fR archive extensions to be handled silently (default: bzip2, (g)zip, tar).
|
||||
.Bd -literal
|
||||
export NNN_ARCHIVE="(7z|bz2|gz|tar|tgz|zip)$"
|
||||
export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
|
||||
|
||||
NOTE: Non-default formats may require a third-party utility.
|
||||
.Ed
|
||||
|
|
|
@ -663,7 +663,7 @@ static const char * const patterns[] = {
|
|||
"sed -i 's|^\\(\\(.*/\\)\\(.*\\)$\\)|#\\1\\n\\3|' %s",
|
||||
"sed 's|^\\([^#/][^/]\\?.*\\)$|%s/\\1|;s|^#\\(/.*\\)$|\\1|' "
|
||||
"%s | tr '\\n' '\\0' | xargs -0 -n2 sh -c '%s \"$0\" \"$@\" < /dev/tty'",
|
||||
"(bz|bz2|gz|tar|taz|tbz|tbz2|tgz|z|zip)$",
|
||||
"\\.(bz|bz2|gz|tar|taz|tbz|tbz2|tgz|z|zip)$",
|
||||
"sed -i 's|^%s\\(.*\\)$|%s\\1|' %s",
|
||||
};
|
||||
|
||||
|
@ -5975,8 +5975,6 @@ nochange:
|
|||
|
||||
/* Get the extension for regext match */
|
||||
tmp = xextension(pent->name, pent->nlen - 1);
|
||||
if (tmp)
|
||||
++tmp;
|
||||
#ifdef PCRE
|
||||
if (tmp && !pcre_exec(archive_pcre, NULL, tmp,
|
||||
pent->nlen - (tmp - pent->name) - 1, 0, 0, NULL, 0)) {
|
||||
|
|
Loading…
Reference in a new issue