[binutils-gdb] [readline] Fix compilation on MinGW

Christian Biesinger cbiesinger@sourceware.org
Tue Aug 13 19:58:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=011168429859e3e3a2342ee043cbc2c7a5cf5e2f

commit 011168429859e3e3a2342ee043cbc2c7a5cf5e2f
Author: Christian Biesinger <cbiesinger@google.com>
Date:   Tue Aug 13 14:00:58 2019 -0500

    [readline] Fix compilation on MinGW
    
    S_ISLNK should not be called outside of an #ifdef.
    
    However, this specific call is actually unnecessary, because
    linkok can only be 0 if S_ISLNK is true, per the code above.
    
    I have sent a bug report to bug-readline, though it does not show
    up in the online archive yet.
    
    2019-08-13  Christian Biesinger  <cbiesinger@google.com>
    
    	* colors.c (_rl_print_color_indicator): Remove unnecessary
    	S_ISLNK check to fix compilation on MinGW.

Diff:
---
 readline/ChangeLog.gdb | 5 +++++
 readline/colors.c      | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index 982ef7b..01b0839 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,8 @@
+2019-08-13  Christian Biesinger  <cbiesinger@google.com>
+
+	* colors.c (_rl_print_color_indicator): Remove unnecessary
+	S_ISLNK check to fix compilation on MinGW.
+
 2019-08-12  Tom Tromey  <tom@tromey.com>
 
 	* Imported readline 8.0.
diff --git a/readline/colors.c b/readline/colors.c
index 53758e0..81aecfe 100644
--- a/readline/colors.c
+++ b/readline/colors.c
@@ -175,7 +175,7 @@ _rl_print_color_indicator (const char *f)
 
   if (linkok == -1 && _rl_color_indicator[C_MISSING].string != NULL)
     colored_filetype = C_MISSING;
-  else if (linkok == 0 && S_ISLNK(mode) && _rl_color_indicator[C_ORPHAN].string != NULL)
+  else if (linkok == 0 && _rl_color_indicator[C_ORPHAN].string != NULL)
     colored_filetype = C_ORPHAN;	/* dangling symlink */
   else if(stat_ok != 0)
     {



More information about the Gdb-cvs mailing list