From 8d173014e9a260502d67ff47ecff6e7502836225 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 15 Aug 2002 19:35:53 +0000 Subject: [PATCH] * fs.h (compute_namelen): New inline function to take care of the d_namlen field if and only if it's needed. --- src/ChangeLog | 3 +++ src/fs.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 03f93e373..b90c74f9d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2002-08-15 Pavel Roskin + * fs.h (compute_namelen): New inline function to take care of + the d_namlen field if and only if it's needed. + * screen.c (string_file_name): Replace non-printable characters with question marks. diff --git a/src/fs.h b/src/fs.h index 2c89e7ce8..1a5bae28f 100644 --- a/src/fs.h +++ b/src/fs.h @@ -84,4 +84,12 @@ # endif /* HAVE_NDIR_H */ #endif /* not (HAVE_DIRENT_H or _POSIX_VERSION) */ +static inline void compute_namelen(struct dirent* dent) { +#ifdef DIRENT_LENGTH_COMPUTED + return; +#else + dent->d_namlen = strlen (dent); +#endif +} + #endif /* !__FS_H */