diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2017-12-20 08:18:37 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-12-20 08:18:37 +0530 |
commit | bc1e74bc5670a11d03d02b796abb25556c01270a (patch) | |
tree | 9c203cb3dd32df682521574db6f3f89166e8162a /nnn.c | |
parent | 106c7c237140c4eb7df7e5e4d74f9bdafee4ee32 (diff) | |
download | nnn-bc1e74bc5670a11d03d02b796abb25556c01270a.tar.gz |
Offset can be derived
Diffstat (limited to 'nnn.c')
-rw-r--r-- | nnn.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -195,7 +195,6 @@ typedef struct entry { time_t t; off_t size; blkcnt_t blocks; /* number of 512B blocks allocated */ - size_t noff; mode_t mode; } *pEntry; @@ -1853,14 +1852,14 @@ dentfill(char *path, struct entry **dents, /* realloc() may result in memory move, we must re-adjust if that happens */ if (pnb != pnamebuf) for (count = 0; count < n; ++count) - (*dents + count)->name = pnamebuf + (*dents + count)->noff; + /* Add file name start offset to new buffer start */ + (*dents + count)->name = pnamebuf + ((ulong)(*dents + count)->name - (ulong)pnb); } dentp = *dents + n; /* Copy file name */ dentp->name = pnamebuf + off; - dentp->noff = off; off += xstrlcpy(dentp->name, namep, NAME_MAX + 1); /* Copy other fields */ |