URI:
       Replace readdir_r to readdir - saait - the most boring static page generator
  HTML git clone git://git.codemadness.org/saait
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit f242e6ade5979fd153b0b2a97a252912fa91b842
   DIR parent c2c2c0934d8b2b362dddd503df382a1b5ae2afb5
  HTML Author: Jaume Devesa <jaume@mailbox.org>
       Date:   Sun, 15 Nov 2020 12:42:36 +0100
       
       Replace readdir_r to readdir
       
       Function `readdir_r` seems to be deprecated in favor of `readdir`.
       Replace the calls to avoid compile-time warnings.
       
       Minor code-style changes + additional note by me:
       
       POSIX says:
       
       "The pointer returned by readdir() points to data which may be overwritten by
       another call to readdir() on the same directory stream. This data is not
       overwritten by another call to readdir() on a different directory stream."
       
       https://pubs.opengroup.org/onlinepubs/009695399/functions/readdir_r.html
       
       So the nested readdir() is safe here.
       
       Diffstat:
         M saait.c                             |       6 +++---
       
       1 file changed, 3 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/saait.c b/saait.c
       @@ -404,7 +404,7 @@ main(int argc, char *argv[])
                struct block *b;
                struct variable *c, *v;
                DIR *bdir, *idir;
       -        struct dirent be, ie, *br, *ir;
       +        struct dirent *ir, *br;
                char file[PATH_MAX + 1], contentfile[PATH_MAX + 1], path[PATH_MAX + 1];
                char outputfile[PATH_MAX + 1], *p, *filename;
                size_t i, j, k, templateslen;
       @@ -438,7 +438,7 @@ main(int argc, char *argv[])
                        exit(1);
                }
        
       -        while (!readdir_r(bdir, &be, &br) && br) {
       +        while ((br = readdir(bdir))) {
                        if (br->d_name[0] == '.')
                                continue;
        
       @@ -466,7 +466,7 @@ main(int argc, char *argv[])
                        memset(t, 0, sizeof(struct template));
                        t->name = estrdup(br->d_name);
        
       -                while (!readdir_r(idir, &ie, &ir) && ir) {
       +                while ((ir = readdir(idir))) {
                                if (!strncmp(ir->d_name, "header.", sizeof("header.") - 1))
                                        b = &(t->blocks[BlockHeader]);
                                else if (!strncmp(ir->d_name, "item.", sizeof("item.") - 1))