mirror of
https://github.com/jarun/nnn.git
synced 2025-01-10 01:49:38 +00:00
Remove redundant checks for g_tmpfpath
This commit is contained in:
parent
99b1b1f489
commit
b0132ba440
24
src/nnn.c
24
src/nnn.c
|
@ -287,7 +287,7 @@ static blkcnt_t ent_blocks;
|
||||||
static blkcnt_t dir_blocks;
|
static blkcnt_t dir_blocks;
|
||||||
static ulong num_files;
|
static ulong num_files;
|
||||||
static bm bookmark[BM_MAX];
|
static bm bookmark[BM_MAX];
|
||||||
static size_t g_tmpfplen; /* path to tmp files for copy without X, keybind help and file stats */
|
static size_t g_tmpfplen;
|
||||||
static uchar g_crc;
|
static uchar g_crc;
|
||||||
static uchar BLK_SHIFT = 9;
|
static uchar BLK_SHIFT = 9;
|
||||||
static uchar opener_flag = F_NOTRACE;
|
static uchar opener_flag = F_NOTRACE;
|
||||||
|
@ -793,13 +793,7 @@ static void showcplist(void)
|
||||||
if (!copybufpos)
|
if (!copybufpos)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_tmpfpath[0])
|
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE], TMP_LEN_MAX - g_tmpfplen);
|
||||||
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE],
|
|
||||||
TMP_LEN_MAX - g_tmpfplen);
|
|
||||||
else {
|
|
||||||
DPRINTF_S(messages[STR_NOHOME_ID]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fd = mkstemp(g_tmpfpath);
|
fd = mkstemp(g_tmpfpath);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
|
@ -2267,11 +2261,7 @@ static bool show_stats(const char *fpath, const char *fname, const struct stat *
|
||||||
size_t r;
|
size_t r;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
if (g_tmpfpath[0])
|
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE], TMP_LEN_MAX - g_tmpfplen);
|
||||||
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE],
|
|
||||||
TMP_LEN_MAX - g_tmpfplen);
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
fd = mkstemp(g_tmpfpath);
|
fd = mkstemp(g_tmpfpath);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
@ -2527,13 +2517,7 @@ static bool show_help(const char *path)
|
||||||
"cc SSHFS mount u Unmount\n"
|
"cc SSHFS mount u Unmount\n"
|
||||||
"b^P Prompt ^N Note = Launcher\n"};
|
"b^P Prompt ^N Note = Launcher\n"};
|
||||||
|
|
||||||
if (g_tmpfpath[0])
|
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE], TMP_LEN_MAX - g_tmpfplen);
|
||||||
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE],
|
|
||||||
TMP_LEN_MAX - g_tmpfplen);
|
|
||||||
else {
|
|
||||||
printmsg(messages[STR_NOHOME_ID]);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
fd = mkstemp(g_tmpfpath);
|
fd = mkstemp(g_tmpfpath);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
|
Loading…
Reference in a new issue