]> Sergey Matveev's repositories - nnn.git/commitdiff
Comment on dirents deep copy
authorlostd <lostd@2f30.org>
Wed, 8 Oct 2014 19:55:44 +0000 (22:55 +0300)
committerlostd <lostd@2f30.org>
Wed, 8 Oct 2014 19:55:44 +0000 (22:55 +0300)
noice.c

diff --git a/noice.c b/noice.c
index 8d6f0d753e68dc88786f8b117698c13e93913690..66d856bc586722351cd4ba50c87df7c45db29931 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -234,6 +234,7 @@ begin:
                if (strcmp(dp->d_name, ".") == 0
                    || strcmp(dp->d_name, "..") == 0)
                        continue;
+               /* Deep copy because readdir(3) reuses the entries */
                dents = realloc(dents, (n + 1) * sizeof(*dents));
                if (dents == NULL)
                        printerr(1, "realloc");