Clear runtime states

This commit is contained in:
Arun Prakash Jana 2022-05-28 23:30:56 +05:30
parent 3a50be93fd
commit 8175571952
No known key found for this signature in database
GPG Key ID: A75979F35C080412
2 changed files with 5 additions and 4 deletions

View File

@ -11,5 +11,5 @@ CheckOptions:
- key: fuchsia-restrict-system-includes.Includes - key: fuchsia-restrict-system-includes.Includes
value: '*,-stdint.h,-stdbool.h' value: '*,-stdint.h,-stdbool.h'
- key: readability-function-size.StatementThreshold - key: readability-function-size.StatementThreshold
value: '905' value: '910'
... ...

View File

@ -4988,14 +4988,14 @@ static size_t handle_bookmark(const char *bmark, char *newpath)
bmark ? xstrsncpy(newpath, bmark, PATH_MAX) : (r = MSG_NOT_SET); bmark ? xstrsncpy(newpath, bmark, PATH_MAX) : (r = MSG_NOT_SET);
else if (fd == '\r') { /* Visit bookmarks directory */ else if (fd == '\r') { /* Visit bookmarks directory */
mkpath(cfgpath, toks[TOK_BM], newpath); mkpath(cfgpath, toks[TOK_BM], newpath);
g_state.selbm = TRUE; g_state.selbm = 1;
} else if (!get_kv_val(bookmark, newpath, fd, maxbm, NNN_BMS)) } else if (!get_kv_val(bookmark, newpath, fd, maxbm, NNN_BMS))
r = MSG_INVALID_KEY; r = MSG_INVALID_KEY;
if (!r && chdir(newpath) == -1) { if (!r && chdir(newpath) == -1) {
r = MSG_ACCESS; r = MSG_ACCESS;
if (g_state.selbm) if (g_state.selbm)
g_state.selbm = FALSE; g_state.selbm = 0;
} }
return r; return r;
@ -6905,6 +6905,7 @@ nochange:
/* Cannot descend in empty directories */ /* Cannot descend in empty directories */
if (!ndents) { if (!ndents) {
cd = FALSE; cd = FALSE;
g_state.selbm = g_state.runplugin = 0;
goto begin; goto begin;
} }
@ -6915,7 +6916,7 @@ nochange:
S_ISLNK(pent->mode) S_ISLNK(pent->mode)
? (realpath(pent->name, newpath) && xstrsncpy(path, lastdir, PATH_MAX)) ? (realpath(pent->name, newpath) && xstrsncpy(path, lastdir, PATH_MAX))
: mkpath(path, pent->name, newpath); : mkpath(path, pent->name, newpath);
g_state.selbm = FALSE; g_state.selbm = 0;
} else } else
mkpath(path, pent->name, newpath); mkpath(path, pent->name, newpath);
DPRINTF_S(newpath); DPRINTF_S(newpath);