tmpcfg.curctx = nextctx;
cfg = tmpcfg;
+ /* Restore the global function pointers alongside the cfg. */
+ entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
+ namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
}
#ifndef NOSSN
r = 'd';
}
- if (cfg.version)
- namecmpfn = &xstrverscasecmp;
-
- if (cfg.reverse)
- entrycmpfn = &reventrycmp;
+ entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
+ namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
} else if (r == CONTROL('T')) {
/* Cycling order: clear -> size -> time -> clear */
if (cfg.timeorder)
lastname = g_ctx[r].c_name;
cfg = g_ctx[r].c_cfg;
+ /* Restore the global function pointers alongside the cfg. */
+ entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
+ namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
cfg.curctx = r;
setdirwatch();