Remove redundant param

This commit is contained in:
Arun Prakash Jana 2021-06-23 23:42:10 +05:30
parent e7f73d95ce
commit d1df9343c6
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -3876,9 +3876,9 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
addch(ind); addch(ind);
} }
static void savecurctx(settings *curcfg, char *path, char *curname, int nextctx) static void savecurctx(char *path, char *curname, int nextctx)
{ {
settings tmpcfg = *curcfg; settings tmpcfg = cfg;
context *ctxr = &g_ctx[nextctx]; context *ctxr = &g_ctx[nextctx];
/* Save current context */ /* Save current context */
@ -3899,7 +3899,7 @@ static void savecurctx(settings *curcfg, char *path, char *curname, int nextctx)
} }
tmpcfg.curctx = nextctx; tmpcfg.curctx = nextctx;
*curcfg = tmpcfg; cfg = tmpcfg;
} }
#ifndef NOSSN #ifndef NOSSN
@ -4068,7 +4068,7 @@ static void set_smart_ctx(int ctx, char *nextpath, char **path, char **lastname,
--ctx; --ctx;
/* Deactivate the new context and build from scratch */ /* Deactivate the new context and build from scratch */
g_ctx[ctx].c_cfg.ctxactive = 0; g_ctx[ctx].c_cfg.ctxactive = 0;
savecurctx(&cfg, nextpath, pdents[cur].name, ctx); savecurctx(nextpath, pdents[cur].name, ctx);
*path = g_ctx[ctx].c_path; *path = g_ctx[ctx].c_path;
*lastdir = g_ctx[ctx].c_last; *lastdir = g_ctx[ctx].c_last;
*lastname = g_ctx[ctx].c_name; *lastname = g_ctx[ctx].c_name;
@ -5855,7 +5855,6 @@ static void statusbar(char *path)
addstr(xitoa((int)sb.st_ino)); /* Show inode number */ addstr(xitoa((int)sb.st_ino)); /* Show inode number */
} }
} }
} }
clrtoeol(); clrtoeol();
} }
@ -6268,7 +6267,7 @@ nochange:
if (g_state.selmode) if (g_state.selmode)
lastappendpos = selbufpos; lastappendpos = selbufpos;
savecurctx(&cfg, path, pdents[cur].name, r); savecurctx(path, pdents[cur].name, r);
/* Reset the pointers */ /* Reset the pointers */
path = g_ctx[r].c_path; path = g_ctx[r].c_path;
@ -6653,7 +6652,7 @@ nochange:
r = handle_context_switch(sel); r = handle_context_switch(sel);
if (r < 0) if (r < 0)
continue; continue;
savecurctx(&cfg, path, pdents[cur].name, r); savecurctx(path, pdents[cur].name, r);
/* Reset the pointers */ /* Reset the pointers */
path = g_ctx[r].c_path; path = g_ctx[r].c_path;
@ -7807,10 +7806,9 @@ int main(int argc, char *argv[])
mmask_t mask; mmask_t mask;
char *middle_click_env = xgetenv(env_cfg[NNN_MCLICK], "\0"); char *middle_click_env = xgetenv(env_cfg[NNN_MCLICK], "\0");
if (middle_click_env[0] == '^' && middle_click_env[1]) middle_click_key = (middle_click_env[0] == '^' && middle_click_env[1])
middle_click_key = CONTROL(middle_click_env[1]); ? CONTROL(middle_click_env[1])
else : (uchar_t)middle_click_env[0];
middle_click_key = (uchar_t)middle_click_env[0];
#endif #endif
const char * const env_opts = xgetenv(env_cfg[NNN_OPTS], NULL); const char * const env_opts = xgetenv(env_cfg[NNN_OPTS], NULL);