aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-07 21:14:43 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-08 04:49:43 +0530
commit6709ac01ad73fbf6e9f0fb313986a11cbf49fbfe (patch)
treecf09356ea1e05850930871cee60eead22fd10894 /src
parenteb9faf083292d14357cd6d803ba4fd570e31a225 (diff)
downloadnnn-6709ac01ad73fbf6e9f0fb313986a11cbf49fbfe.tar.gz
Code reformat
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 515aa46..5810913 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4166,9 +4166,6 @@ int main(int argc, char *argv[])
idletimeout = xatoi(getenv(env_cfg[NNN_IDLE_TIMEOUT]));
DPRINTF_U(idletimeout);
- /* Get the clipboard copier, if set */
- copier = getenv(env_cfg[NNN_COPIER]);
-
home = getenv("HOME");
DPRINTF_S(home);
@@ -4188,19 +4185,22 @@ int main(int argc, char *argv[])
cfg.trash = 1;
}
- if (home) {
- /* Prefix for other temporary ops */
+ /* Prefix for other temporary ops */
+ if (home)
g_tmpfplen = xstrlcpy(g_tmpfpath, home, HOME_LEN_MAX);
- } else if (getenv("TMPDIR"))
- g_tmpfplen = xstrlcpy(g_tmpfpath, getenv("TMPDIR"), HOME_LEN_MAX);
else if (xdiraccess("/tmp"))
g_tmpfplen = xstrlcpy(g_tmpfpath, "/tmp", HOME_LEN_MAX);
+ else if ((copier = getenv("TMPDIR")) != NULL)
+ g_tmpfplen = xstrlcpy(g_tmpfpath, copier, HOME_LEN_MAX);
if (!cfg.picker && g_tmpfplen) {
xstrlcpy(g_cppath, g_tmpfpath, PATH_MAX);
xstrlcpy(g_cppath + g_tmpfplen - 1, "/.nnncp", PATH_MAX - g_tmpfplen);
}
+ /* Get the clipboard copier, if set */
+ copier = getenv(env_cfg[NNN_COPIER]);
+
/* Disable auto-select if opted */
if (getenv(env_cfg[NNN_NO_AUTOSELECT]))
cfg.autoselect = 0;