mirror of
https://github.com/jarun/nnn.git
synced 2025-01-10 01:49:38 +00:00
Minor update
This commit is contained in:
parent
9972c4bdb0
commit
7b31a356d2
|
@ -1539,17 +1539,13 @@ static char *findinsel(char *startpos, int len)
|
||||||
size_t buflen = selbufpos - (startpos - pselbuf);
|
size_t buflen = selbufpos - (startpos - pselbuf);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/*
|
/* memmem(3): not specified in POSIX.1, but present on a number of other systems. */
|
||||||
* memmem(3):
|
|
||||||
* This function is not specified in POSIX.1, but is present on a number of other systems.
|
|
||||||
*/
|
|
||||||
found = memmem(found, buflen - (found - startpos), g_sel, len);
|
found = memmem(found, buflen - (found - startpos), g_sel, len);
|
||||||
if (!found)
|
if (!found)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (found == startpos || *(found - 1) == '\0')
|
if (found == startpos || *(found - 1) == '\0')
|
||||||
return found;
|
return found;
|
||||||
/* We found g_sel as a substring of a path, move forward */
|
found += len; /* We found g_sel as a substring of a path, move forward */
|
||||||
found += len;
|
|
||||||
if (found >= startpos + buflen)
|
if (found >= startpos + buflen)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1563,6 +1559,7 @@ static int markcmp(const void *va, const void *vb)
|
||||||
return ma->startpos - mb->startpos;
|
return ma->startpos - mb->startpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* scanselforpath() must be called before calling this */
|
||||||
static inline void findmarkentry(size_t len, struct entry *dentp)
|
static inline void findmarkentry(size_t len, struct entry *dentp)
|
||||||
{
|
{
|
||||||
if (!(dentp->flags & FILE_SCANNED)) {
|
if (!(dentp->flags & FILE_SCANNED)) {
|
||||||
|
|
Loading…
Reference in a new issue