mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Minor refactor
This commit is contained in:
parent
4bd742dafb
commit
ed616cf746
15
src/nnn.c
15
src/nnn.c
|
@ -937,12 +937,10 @@ static void *xmemrchr(uchar *s, uchar ch, size_t n)
|
||||||
|
|
||||||
uchar *ptr = s + n;
|
uchar *ptr = s + n;
|
||||||
|
|
||||||
do {
|
do
|
||||||
--ptr;
|
if (*--ptr == ch)
|
||||||
|
|
||||||
if (*ptr == ch)
|
|
||||||
return ptr;
|
return ptr;
|
||||||
} while (s != ptr);
|
while (s != ptr);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -3264,13 +3262,12 @@ static void save_session(bool last_session, int *presel)
|
||||||
char *sname;
|
char *sname;
|
||||||
bool status = FALSE;
|
bool status = FALSE;
|
||||||
|
|
||||||
|
memset(&header, 0, sizeof(session_header_t));
|
||||||
|
|
||||||
header.ver = SESSIONS_VERSION;
|
header.ver = SESSIONS_VERSION;
|
||||||
|
|
||||||
for (i = 0; i < CTX_MAX; ++i) {
|
for (i = 0; i < CTX_MAX; ++i) {
|
||||||
if (!g_ctx[i].c_cfg.ctxactive) {
|
if (g_ctx[i].c_cfg.ctxactive) {
|
||||||
header.pathln[i] = header.nameln[i]
|
|
||||||
= header.lastln[i] = header.fltrln[i] = 0;
|
|
||||||
} else {
|
|
||||||
if (cfg.curctx == i && ndents)
|
if (cfg.curctx == i && ndents)
|
||||||
/* Update current file name, arrows don't update it */
|
/* Update current file name, arrows don't update it */
|
||||||
xstrlcpy(g_ctx[i].c_name, dents[cur].name, NAME_MAX + 1);
|
xstrlcpy(g_ctx[i].c_name, dents[cur].name, NAME_MAX + 1);
|
||||||
|
|
Loading…
Reference in a new issue