public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Cygwin: gen_full_path_at: drop never reached code
@ 2023-07-26 13:18 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-07-26 13:18 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ae03aa7303bff5d6814bc6c9e681128aee42eb6a

commit ae03aa7303bff5d6814bc6c9e681128aee42eb6a
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Wed Jul 12 13:31:31 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Jul 26 15:13:47 2023 +0200

    Cygwin: gen_full_path_at: drop never reached code
    
    The check if the local variable p is NULL is useless.  The preceeding
    code always sets p to a valid pointer, or it crashes if path_ret is
    invalid (which would be a bug in Cygwin).
    
    Fixes: c57b57e5c43a ("* cygwin.din: Sort.")
    Reviewed-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/syscalls.cc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index f1cd5693edf5..8d3ec46f3a3c 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -4449,11 +4449,6 @@ gen_full_path_at (char *path_ret, int dirfd, const char *pathname,
 	    }
 	  p = stpcpy (path_ret, cfd->get_name ());
 	}
-      if (!p)
-	{
-	  set_errno (ENOTDIR);
-	  return -1;
-	}
       if (pathname)
 	{
 	  if (!*pathname)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-26 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 13:18 [newlib-cygwin/main] Cygwin: gen_full_path_at: drop never reached code Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).