From 395068dac8407d8ed39864727ca192e5490a48cf Mon Sep 17 00:00:00 2001 From: k-pop connoisseur Date: Fri, 13 Dec 2024 01:55:57 +0100 Subject: [PATCH] fix 's r' session restore #1968 --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index d66dde7f..b1052f9c 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4543,7 +4543,7 @@ static bool load_session(const char *sname, char **path, char **lastdir, char ** *lastdir = g_ctx[cfg.curctx].c_last; *lastname = g_ctx[cfg.curctx].c_name; set_sort_flags('\0'); /* Set correct sort options */ - xstrsncpy(curssn, sname, NAME_MAX); + xstrsncpy(curssn, sname ? sname : "@", NAME_MAX); status = TRUE; END: