aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-09-01 10:35:04 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-09-01 10:45:10 +0530
commitdcc9b627600bce25f33ec401a19c60fac85fbf1f (patch)
tree9f5422da92bdb89c65593b863b1f1743d7265249
parent1e5a0b8c5bc78462956d01c647293a7da594c36f (diff)
downloadnnn-dcc9b627600bce25f33ec401a19c60fac85fbf1f.tar.gz
Adjusting number of cols is redundant with shortening.
-rw-r--r--nnn.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/nnn.c b/nnn.c
index 56aa385..8b71ae5 100644
--- a/nnn.c
+++ b/nnn.c
@@ -1198,15 +1198,9 @@ unescape(const char *str, uint maxcols)
static void
printent(struct entry *ent, int sel)
{
- static int ncols;
static char *pname;
- if (PATH_MAX + 16 < COLS)
- ncols = PATH_MAX + 16;
- else
- ncols = COLS;
-
- pname = unescape(ent->name, ncols - 5);
+ pname = unescape(ent->name, COLS - 5);
if (S_ISDIR(ent->mode))
printw("%s%s/\n", CURSYM(sel), pname);
@@ -1255,16 +1249,10 @@ coolsize(off_t size)
static void
printent_long(struct entry *ent, int sel)
{
- static int ncols;
static char buf[18], *pname;
- if (PATH_MAX + 32 < COLS)
- ncols = PATH_MAX + 32;
- else
- ncols = COLS;
-
strftime(buf, 18, "%d-%m-%Y %H:%M", localtime(&ent->t));
- pname = unescape(ent->name, ncols - 32);
+ pname = unescape(ent->name, COLS - 32);
if (sel)
attron(A_REVERSE);