From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113068 invoked by alias); 21 Sep 2019 15:42:42 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 113061 invoked by uid 89); 21 Sep 2019 15:42:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=enoent, ENOENT, cygwin-patches, cygwinpatches X-HELO: NAM03-DM3-obe.outbound.protection.outlook.com Received: from mail-eopbgr800122.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) (40.107.80.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Sep 2019 15:42:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bM+BWmnKAiM711dt2a4npC/2d5cw1yz7RZMzRFJcmH+hP2wU5u/+d7aDYKA/hEY/K8AB89oWThbkezhjmUXJsp1zB44IvyBe8eLEXVUQO9vg5JL6AfaKGiyaW8UODrBDpo5urHQ0ztQHSp12vpa60ePmxQ/HG/qooZ4fw6pSKbsPO6Dv7nzx28ly4v6rqs7cT2Jsagfx/kM/w6gM+tvvuCky7N1WB636AvyDcOPcCf1PBcoTwmscKzPWSE7G6L1gSocfkD35sBbGrVCb3ObL8V/xJ80EB7mOgTviETkLuFTRXYBX1kg61HoXYdGNS/qAcVtycMxFuO0W6ASUD2Ru4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=598Xd2cJIJgSGuAkoHmhyeXqbQ19pPPLLS5UnKiJVAc=; b=Iy1/zSrGzqVMmtBcU1TuIPiibZbDjf4TnqUR87vIAztNSL6FF6xRYYcj1qc0X5lBIIwstCpffnAsRQ16QvYB8pfiKtFfX/BXgTuZrMfKwLGsXaCe9MG2Lt+Bwl+tqpl0JH/yiPW965BbqP2TUgT7E6NAyv0K4O3FZGpym/qgKn4FeDdcexk+Mb06trGk7EkKS3z82uX+Wm+qSNwpiEcFxvsDepVqy5pEyByFTKwf0itXmMsYgs4p5NnMbhUNkc/LlfBhHLgL7ymeKSQLxGy4S5E1OPKy8FGAfUVVurbzmU/TZGZb7E3Iax7eY+6Ya2UzXSWXIvLhP57lDlLkrenczA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=598Xd2cJIJgSGuAkoHmhyeXqbQ19pPPLLS5UnKiJVAc=; b=Uh2XWKlGzG0GRgsUjU4TfARLQhUQI7q5Lj8sxDt16zakhcylfyAq/mShoLEaybUNu1AFAF+U/Iv871iT3zXvSiVC7ftZBKnDeTqOZxEWHf0s/yQhIJuOZGqygmUhkNfX3ZrYiWOCGIyKYdRz2s9f/ey7oV6yxQL8Hv133dF9FfM= Received: from DM6PR04MB5738.namprd04.prod.outlook.com (20.179.51.81) by DM6PR04MB6329.namprd04.prod.outlook.com (10.141.161.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.19; Sat, 21 Sep 2019 15:42:37 +0000 Received: from DM6PR04MB5738.namprd04.prod.outlook.com ([fe80::998b:a76c:fc2b:1473]) by DM6PR04MB5738.namprd04.prod.outlook.com ([fe80::998b:a76c:fc2b:1473%4]) with mapi id 15.20.2263.023; Sat, 21 Sep 2019 15:42:37 +0000 From: Ken Brown To: "cygwin@cygwin.com" Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ... Date: Sat, 21 Sep 2019 16:07:00 -0000 Message-ID: <8b163d0f-680f-e4ea-098c-703d0fac87fd@cornell.edu> References: <20190827152549.GY11632@calimero.vinschen.de> <3E262D05-F393-453A-9E43-B248DDE50812@solidrocksystems.com> <20190828125939.GL11632@calimero.vinschen.de> <421ac447-b249-da21-1ca5-228041cfc884@redhat.com> <20190828141556.GM11632@calimero.vinschen.de> <20190828142220.GN11632@calimero.vinschen.de> <4a87b7a940fb0cf76aac5f3bc5b1a8b3@smtp-cloud7.xs4all.net> <3eca1ecf200f0075efd154544c2fd5b4@smtp-cloud7.xs4all.net> In-Reply-To: <3eca1ecf200f0075efd154544c2fd5b4@smtp-cloud7.xs4all.net> user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown@cornell.edu; x-ms-oob-tlc-oobclassifiers: OLM:4941; received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-ID: <34467D6E4A66B34091D59C7CA4E06A52@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EA51JEJu7HhhzH0e+seS897nhyz6lQrgqcPqThiv+ubHBG2DbDKi9DwUf5ST8QzwK1nuZtPBrBPPbZug0kDzqw== X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00216.txt.bz2 On 9/20/2019 5:11 AM, Houder wrote: > As I said already, the snippet should NOT be executed in general. Perhaps > it is another left-over from old times that should have been deleted. You're absolutely right. Prior to commit b0717aae0, the code looked like t= his: if (strncmp (path, "\\\\.\\", 4)) { /* Windows ignores trailing dots and spaces in the last path component, and ignores exactly one trailing dot in inner path components. */ char *tail =3D NULL; [...] if (!tail || tail =3D=3D path) /* nothing */; else if (tail[-1] !=3D '\\') { *tail =3D '\0'; strip_tail =3D true; } else { error =3D ENOENT; return; } } Note the use of a *local* tail variable. It's a pointer into path, as you = can=20 see by looking at the part I omitted. In commit b0717aae0, Corinna intended to disable this code, but she=20 inadvertently disabled only part of it. Here's the relevant part of that c= ommit: @@ -1170,6 +1225,7 @@ out: { if (strncmp (path, "\\\\.\\", 4)) { +#if 0 /* Windows ignores trailing dots and spaces in the last path component, and ignores exactly one trailing dot in inner path components. */ @@ -1190,7 +1246,7 @@ out: tail =3D NULL; } } - +#endif if (!tail || tail =3D=3D path) /* nothing */; else if (tail[-1] !=3D '\\') In particular, the declaration of the local tail variable is in the disable= d=20 code, so the cruft at the end is referring to the other tail, which points = into=20 path_copy. [A later commit removed the disabled code.] I'll fix this and then look at your patches to mkdir and rmdir. It would b= e=20 very helpful if you would write these as a patch series with cover letter, = using=20 git format-patch, and send them to the cygwin-patches list. Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple