void
redraw(void)
{
+ char cwd[PATH_MAX], cwdresolved[PATH_MAX];
+ size_t ncols;
int nlines, odd;
- char *cwd;
int i;
nlines = MIN(LINES - 4, n);
DPRINTF_S(path);
/* No text wrapping in cwd line */
- cwd = xmalloc(COLS * sizeof(char));
- strlcpy(cwd, path, COLS * sizeof(char));
- cwd[COLS - strlen(CWD) - 1] = '\0';
-
- printw(CWD "%s\n\n", cwd);
+ ncols = COLS;
+ if (ncols > PATH_MAX)
+ ncols = PATH_MAX;
+ strlcpy(cwd, path, ncols);
+ cwd[ncols - strlen(CWD) - 1] = '\0';
+ realpath(cwd, cwdresolved);
+
+ printw(CWD "%s\n\n", cwdresolved);
/* Print listing */
odd = ISODD(nlines);