Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: [PATCH] [readline] Fix compilation on MinGW
Date: Tue, 13 Aug 2019 19:04:00 -0000	[thread overview]
Message-ID: <20190813190436.215693-1-cbiesinger@google.com> (raw)

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.
---
 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 982ef7b710..01b083951e 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 53758e0e77..81aecfe0c8 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)
     {
-- 
2.23.0.rc1.153.gdeed80330f-goog


             reply	other threads:[~2019-08-13 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 19:04 Christian Biesinger via gdb-patches [this message]
2019-08-13 19:46 ` Tom Tromey
2019-08-13 19:59   ` Christian Biesinger via gdb-patches
2019-09-15  1:49     ` Christian Biesinger via gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190813190436.215693-1-cbiesinger@google.com \
    --to=gdb-patches@sourceware.org \
    --cc=cbiesinger@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox