mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
fixed two compiling bugs for libedit
acinclude.m4: added macro to check if dirent.d_namlen is defined cmd-line-utils/libedit/config.h: added define for __attribute__ cmd-line-utils/libedit/readline.c: checked STRUCT_DIRENT_HAS_D_NAMLEN instead of old enumeration of problem platforms configure.in: added checking if dirent has d_namlen member field
This commit is contained in:
parent
51fce2d247
commit
8bf3885883
4 changed files with 44 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue