summaryrefslogtreecommitdiff
path: root/lib/savedir.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-10-17 14:01:44 +0000
committerJim Meyering <jim@meyering.net>1994-10-17 14:01:44 +0000
commitd8843f4b6e768dfe6161dee19f9c50d69283522c (patch)
tree62842d1ec05c38a72eb12092fae9bdc7e0727f83 /lib/savedir.c
parentf45f10b17d36144ad2c28eb3e804c535d6808822 (diff)
downloadcoreutils-d8843f4b6e768dfe6161dee19f9c50d69283522c.tar.xz
.
Diffstat (limited to 'lib/savedir.c')
-rw-r--r--lib/savedir.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/savedir.c b/lib/savedir.c
index 32c793b60..9a5736451 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -27,22 +27,22 @@
#include <unistd.h>
#endif
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#define NLENGTH(direct) (strlen((direct)->d_name))
-#else /* not HAVE_DIRENT_H */
-#define dirent direct
-#define NLENGTH(direct) ((direct)->d_namlen)
-#ifdef HAVE_SYS_NDIR_H
-#include <sys/ndir.h>
-#endif /* HAVE_SYS_NDIR_H */
-#ifdef HAVE_SYS_DIR_H
-#include <sys/dir.h>
-#endif /* HAVE_SYS_DIR_H */
-#ifdef HAVE_NDIR_H
-#include <ndir.h>
-#endif /* HAVE_NDIR_H */
-#endif /* HAVE_DIRENT_H */
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
#ifdef CLOSEDIR_VOID
/* Fake a return value. */
@@ -100,7 +100,7 @@ savedir (dir, name_size)
|| (dp->d_name[1] != '\0'
&& (dp->d_name[1] != '.' || dp->d_name[2] != '\0')))
{
- unsigned size_needed = (namep - name_space) + NLENGTH (dp) + 2;
+ unsigned size_needed = (namep - name_space) + NAMLEN (dp) + 2;
if (size_needed > name_size)
{