summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/libedit/config.h6
-rw-r--r--cmd-line-utils/libedit/readline.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/cmd-line-utils/libedit/config.h b/cmd-line-utils/libedit/config.h
index 3a8d0fd4b55..b6f002d5b9e 100644
--- a/cmd-line-utils/libedit/config.h
+++ b/cmd-line-utils/libedit/config.h
@@ -6,3 +6,9 @@
#define __COPYRIGHT(x)
#define __RENAME(x)
#define _DIAGASSERT(x)
+
+#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define __attribute__(A)
+#endif
+
+
diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c
index 13b0369de96..5b40ade582c 100644
--- a/cmd-line-utils/libedit/readline.c
+++ b/cmd-line-utils/libedit/readline.c
@@ -1345,7 +1345,7 @@ filename_completion_function(const char *text, int state)
/* otherwise, get first entry where first */
/* filename_len characters are equal */
if (entry->d_name[0] == filename[0]
-#if defined(__SVR4) || defined(__linux__)
+#ifndef STRUCT_DIRENT_HAS_D_NAMLEN
&& strlen(entry->d_name) >= filename_len
#else
&& entry->d_namlen >= filename_len
@@ -1358,7 +1358,7 @@ filename_completion_function(const char *text, int state)
if (entry) { /* match found */
struct stat stbuf;
-#if defined(__SVR4) || defined(__linux__)
+#ifndef STRUCT_DIRENT_HAS_D_NAMLEN
len = strlen(entry->d_name) +
#else
len = entry->d_namlen +