]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix issue with file details
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 1 Apr 2019 14:44:49 +0000 (20:14 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 1 Apr 2019 14:44:49 +0000 (20:14 +0530)
src/nnn.c

index 0279fe9d40b72ee428767090b0de86c07410a554..6ea7a03e5257952708950aaa795081127043bed8 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2286,6 +2286,7 @@ static bool show_stats(const char *fpath, const char *fname, const struct stat *
 {
        int fd;
        char *p, *begin = g_buf;
+       size_t r;
        FILE *fp;
 
        if (g_tmpfpath[0])
@@ -2298,8 +2299,11 @@ static bool show_stats(const char *fpath, const char *fname, const struct stat *
        if (fd == -1)
                return FALSE;
 
-       xstrlcpy(g_buf, "stat ", 6);
-       xstrlcpy(g_buf + 5, fpath, PATH_MAX);
+       r = xstrlcpy(g_buf, "stat \'", PATH_MAX);
+       r += xstrlcpy(g_buf + r - 1, fpath, PATH_MAX);
+       g_buf[r - 2] = '\'';
+       g_buf[r - 1] = '\0';
+       DPRINTF_S(g_buf);
 
        fp = popen(g_buf, "r");
        if (fp != NULL) {