static char *xbasename(char *path)
{
char *base = xmemrchr((uchar *)path, '/', strlen(path));
+
return base ? base + 1 : path;
}
static char *xitoa(uint val)
{
- const char hexbuf[] = "0123456789";
+ static const char hexbuf[] = "0123456789";
static char ascbuf[32] = {0};
int i;
}
/* Reset copy indicators */
-static void resetcpind()
+static void resetcpind(void)
{
int r = 0;
static int entrycmp(const void *va, const void *vb)
{
- const struct entry * pa = (pEntry)va;
- const struct entry * pb = (pEntry)vb;
+ const struct entry *pa = (pEntry)va;
+ const struct entry *pb = (pEntry)vb;
if ((pb->flags & DIR_OR_LINK_TO_DIR) != (pa->flags & DIR_OR_LINK_TO_DIR)) {
if (pb->flags & DIR_OR_LINK_TO_DIR)
}
ssize_t count = xstrlcpy(buf, home, PATH_MAX);
+
xstrlcpy(buf + count - 1, bookmark[r].loc + 1, PATH_MAX - count - 1);
} else
xstrlcpy(buf, bookmark[r].loc, PATH_MAX);
printptr(&dents[i], i == cur, ncols);
} else {
const int odd = ISODD(nlines);
+
nlines >>= 1;
for (i = cur - nlines; i < cur + nlines + odd; ++i)
printptr(&dents[i], i == cur, ncols);
}
(r == 'y' || r == 'Y') ? archive_selection(tmp, path)
- : spawn(utils[APACK], tmp, dents[cur].name,
+ : spawn(utils[APACK], tmp, dents[cur].name,
path, F_NORMAL);
break;
case SEL_OPENWITH: