From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 6A4133858D35; Wed, 26 Jul 2023 13:20:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A4133858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690377613; bh=RTKsYzSrAiiEPoPvXhv5vvfWcYgIdFbE53JuU+RXS3c=; h=From:To:Subject:Date:From; b=sWu+kO7XKa7SIAvw7UxaJx59lWJS1afRfA3Wa8PTwAYVPMns86XYHHHxytE7Hi8X4 B9+WCRCqXK1t15qFq6webpJV4zDCkgsfSaBMRrHpXGiRVIWAWZg59DiHqotC3s2Hsu GMQJmu3xLKc0WZ1efqgtacYLow8GAnwq3KUYXGAw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_4-branch] Cygwin: gen_full_path_at: drop never reached code X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/cygwin-3_4-branch X-Git-Oldrev: 119c41065ae65c224b8d68397445c861065c3399 X-Git-Newrev: 26775886a3b4d3c858f40f6f42b61f866d9c1c2a Message-Id: <20230726132013.6A4133858D35@sourceware.org> Date: Wed, 26 Jul 2023 13:20:13 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D26775886a3b= 4d3c858f40f6f42b61f866d9c1c2a commit 26775886a3b4d3c858f40f6f42b61f866d9c1c2a Author: Corinna Vinschen AuthorDate: Wed Jul 12 13:31:31 2023 +0200 Commit: Corinna Vinschen CommitDate: Wed Jul 26 15:19:59 2023 +0200 Cygwin: gen_full_path_at: drop never reached code =20 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). =20 Fixes: c57b57e5c43a ("* cygwin.din: Sort.") Reviewed-by: Johannes Schindelin Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/syscalls.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 5adc614ec30f..a8b8206af0fc 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -4447,11 +4447,6 @@ gen_full_path_at (char *path_ret, int dirfd, const c= har *pathname, } p =3D stpcpy (path_ret, cfd->get_name ()); } - if (!p) - { - set_errno (ENOTDIR); - return -1; - } if (pathname) { if (!*pathname)