delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/07/14/15:27:51

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADE1F398B879
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1626290869;
bh=kp92+gkDV6CBVVsxq4z8hQQSr2mmOLVoJu5NQZDjEMc=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=qU6khPJZQK9veVTO0CrBMGZT2jObW+krIKKzhBZpazpWH9Jqv30W4YJ0Bo2oQEWNk
2PSoowyIUqMMZq5SbSvzcYfShLOjJH6ycZRgjtoa667/OA6ciGHgA0Nt8e488sASkL
Pq8JgcnS1NBeTISYBMCqLBSjbaT4ln5wvieuF8oY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 413FB398B852
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=lcmPQnA8YvUrzEKjttZhnKajY+ylP80mPuIK7dJgpv+ntCLB7BShVPMJZLS5sLLG6RP5MTjptv9N8qAznlLW7w9oO6FIQvCwq8aBpdVpthQSyorphW7u95f0Xi/KYSOjYBFURLL0f57xdWMRvKoU17MVWyKMS9mNl/ASIOAg16PuMj9yYmB+EPx5jZwoEa5wLWL+xhXfm/dUkpgf/Cod6fOYbWB3CPhz+biVEXgR3ilI71kH2lAh2n4JZxjKItp6X1XGlgDUZZmHB3wLK7WYg2Ag8wM1/RTeRm4uNr3LNkgCk07aVHqbw2/whqhe9zSeT+OrBU5xnV8h5QLN/F6R/Q==
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=QV2K5tWEg+KWAEULYEccpSSAAM3kR1QKezRFDrJJs8k=;
b=ng3J4pnHJjwYqp+RuKzMbFJ+kZRYRWkf0jK+vjxLC2MUtI84hm5hsnAI71MZEQoSK+l5ZwEB6wllzsE+c80dR6jUpwQSyptgVfZYFijYDmlBNcLOS8Oi3NwW8gdYNWGESjAPbSZLfx0Nq40STf+FC4oX3FF1Mh/6rioyynrq2fEd3qvFIw+bFRhgNCAPNezbYZrsxvH/aNKkekj1ARS2PEG3hTfVaZGDKgItPTrIKQpZTiS//eROeUSMiugC4M/x1d3rJCT7mJEUfujj751Vm0a5/xKXrp5MnlyLqNDMlobMi3voU65JA/+hDX8pupZYTCLKG/95ig0gdYFhZ0VB/A==
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
Subject: Re: cygpath and star character
To: Tomas Jura <tomas DOT jura1 AT gmail DOT com>, cygwin AT cygwin DOT com
References: <7fa873dc-e4cb-8217-5844-82db627bd871 AT gmail DOT com>
Message-ID: <c1720bc3-8ea5-b4a4-fb46-599474b51d88@cornell.edu>
Date: Wed, 14 Jul 2021 15:26:04 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
In-Reply-To: <7fa873dc-e4cb-8217-5844-82db627bd871@gmail.com>
X-ClientProxiedBy: MN2PR10CA0001.namprd10.prod.outlook.com
(2603:10b6:208:120::14) To BN7PR04MB4388.namprd04.prod.outlook.com
(2603:10b6:406:f8::19)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: e55bdea7-bb19-4474-0c93-08d946fd39fb
X-MS-TrafficTypeDiagnostic: BN8PR04MB6372:
X-Microsoft-Antispam-PRVS: <BN8PR04MB6372B5C7C09A283A736C9DF8D8139 AT BN8PR04MB6372 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:5797;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: Vuz/Qq67VGz6IcqjmfWSyCyCl2OVuUKVB235o+PwvrsgNeDdXn+LofCEt8QR9tQPFxGunyun2Hdk0f+AkyhTB+3qiicacGx44QcbDK8dRwo9xhdCWbPt8RZQ1s+y60ozuxYOnzbaycQIEVvSWhlrsrSNK4XVuBbLs2Tdv2jS4e3EoCuGx5QWfUt4/iQfSzKo7udPpPAPUCvtRFNmS2OGSmtdWNUVfW2cgKMnAs5uTeWrrosvAkGkEtHRL9esLmFwzTse2s+iQUx7/WQ05Zg4cwidfWtgHtI5lf3+bZmEiTbVhwAPIdKLQy3bFFhZVS4sKk089jboHciIU3IxOXf5stIHK1pg0M41ZzGsuzRmPwzgyc72fXSHoENm4dFItUSYwiXNAE6VUNcdHAH1vDXa98SUEq3x6RPZTS49t2+2Wf+9x77wyVlquOBD6BQC9Wtyh8KrK34f8tv1mFx9l9DlIv463SLFt8YTXWkP2EcWHUj/UtgE++M2XYRLfofaga3p6JGu6tEu+c+wppoq8VPW0FRahTBfwjEqkL4o4xJkUB2fpZ9jYCUOx9MYR5Lu250X7ASp5vuBA4sFE9jbTLH1M775vEhWYRuZtFXIGRYbeAiGcoS1w6a5nRN72gQ60FwNEnjJ+XofPgxbRejkaJluFHXQ4Jwe73StoIP0twfsxdQzZHkTdqSG0E+ZRhojJmXFPRqiOPkMDam4qQ98ip1gouciAaQnKfE6EkDFRFuAzCWDfe8GOSJawqI4aMjcTEY3mfTgNRfyTGgYMHryPkeamCvdTZWm9OlOumWguprfXO4PIqNeoy0KaHJYC+0Ymy7J
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFS:(4636009)(346002)(396003)(376002)(136003)(366004)(39860400002)(5660300002)(86362001)(786003)(66556008)(8936002)(53546011)(75432002)(8676002)(3480700007)(2906002)(31686004)(478600001)(36756003)(31696002)(2616005)(316002)(6486002)(186003)(66476007)(38100700002)(66946007)(966005)(43740500002)(45980500001);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?Windows-1252?Q?teGtjHmafv2GEqSrWb4wu38nktJX4169ZIqvNCbOzzsKkRjujlXMxpLt?=
=?Windows-1252?Q?bTrdrMtFyCamS/NkOFJ4AUUW1cwOGwpq93NOnZsmFiZ12uIMtDBv//T1?=
=?Windows-1252?Q?vfzgiqnT4xeCpD6zt3iLz+8XHfuiYdDBr0Dj3X4bWRyz4Wyf+hOmfeMl?=
=?Windows-1252?Q?ytc8Ov8PUWRqYEOcZ3T83sNGs0Jpi6atIHOqbF6VdYeHKCJoXRY9gyuW?=
=?Windows-1252?Q?Z0FB0tvb075ZMDAlD/ppfM6nsXR6hW5VftXKmy0tVy22lps+Hdf2l8qy?=
=?Windows-1252?Q?rjTSLG7EyFk2Y3b1aPZ76MM7wmo6qnZ/YFL23FiLHup3kde2BWisDMcj?=
=?Windows-1252?Q?KO8+20YfX5D1SnHstxDY+eODpLzNr0WxxrUOby4kX0WcQtGgFij7H9TJ?=
=?Windows-1252?Q?NRHrgPNeXYY1dAgbfWpo/XYXNk0327117HLLZTenkZSRDvMNdiTySqp4?=
=?Windows-1252?Q?jIgO3kXm0NN13Nr81WcTyo3k3F+asTVYtsUToHV/p6oFKDBMtOewak8n?=
=?Windows-1252?Q?k19cDTblwLrLjk2Ws12tJ9++45myKJiTZ4awkINFm6pEinmlOe9KAf6q?=
=?Windows-1252?Q?kDioKeGqoZcdgaBcxrP5eU6JV/a1VuSUFDb/0oVwoSxg0wYzYPulO6+r?=
=?Windows-1252?Q?2f7wJjSEK8NO12XosVd6mBu5ZrHVhBpOqP5VeqHV5d9dWj1Pbj2gLx14?=
=?Windows-1252?Q?CDhRzeo/r4vDF+ZY90tEaCSbMfVdUdI5idkz2CAJe2cBzwF8926tZVPA?=
=?Windows-1252?Q?EBcPsO5gRE2ACKboxF+1nlC6dj/fwm5Qh088QpHX7HZi1FlSO3FGKqh2?=
=?Windows-1252?Q?Hl6xxBAVx6TnzhFZzkT8ri5N7sbZC2tZlvzvOoNqLQxuHKzmddm0Vpto?=
=?Windows-1252?Q?Ev2ouXKk+f7gkySKCeYSQxmEq7SyJGTJuvwKcJiTCQF21MnTtVoft1gw?=
=?Windows-1252?Q?wtHIus2KLJG7Poykvu/bMWJD+SSxFU+tbKN45y2uHe1vVUt0dc6u62ua?=
=?Windows-1252?Q?J5ubeXG4iYhfa4dO+lhV9aLRz/OeeyJewxQr8SB7hAWn1xsltFf7eHpV?=
=?Windows-1252?Q?Fq0lvFWu4LhqkKpydz5F6cP+S867i0QaecYqEEXf4nalm+hT2Yl51nLn?=
=?Windows-1252?Q?CmXV4E2RK4CHTotOHgYddRNavcJzeLPKjAR+fRZIkibAw/4J1ZpAZFFL?=
=?Windows-1252?Q?yiF/Xm8ud3Ml/sRKArGGOuZw4ogbO/ARhhE/nV31EBoVXgzFFYRwcLLj?=
=?Windows-1252?Q?O8Qsv2AG4Ww6CYztP5XM+OWld4IfMGDtZr3ey+/yD6WXe16wCpQ2vE39?=
=?Windows-1252?Q?DrLeDeHcUvWSK4eBH6s/oasfO/7ASaXTPWkaq7O0qlRg92xdf/wq6pyc?=
=?Windows-1252?Q?Ac+Qng0vku0xKofuThKEJcogM2z1ITRodv3LHE0HNyv+QmgqL7kXn7VT?=
=?Windows-1252?Q?zQ+vGr6Gl99icJeCXt7dlWI/qVuOAV8zpROAy/mNywsN+6w2OQlLs73u?=
=?Windows-1252?Q?XwkIG8Jy?=
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: e55bdea7-bb19-4474-0c93-08d946fd39fb
X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 19:26:06.3959 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5B9vRJZKHmrNygsbThh8Ozw9YJN3gZUDvFeN30MUqI/lpX7LbQzFSR9Ua6hZKvdHY5AmkcKQg/Mgz0MKGv7ecg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR04MB6372
X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00, BODY_8BITS,
DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER,
NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Ken Brown via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Ken Brown <kbrown AT cornell DOT edu>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 16EJRooj028870

On 7/14/2021 4:10 AM, Tomas Jura via Cygwin wrote:
> Hi
> 
> I found a strange behaviour of the program cygpath program
> 
> 0 >cygpath -w "./*/*"           <--- IMHO wrong output
>   \
> 
> 0 >cygpath -w "./*/*"  | od -a                   <--- a detailed dump
> 0000000   o nul   *   \   o nul   *  nl
> 0000010

What you're seeing here is a consequence of the way Cygwin handles valid POSIX 
file names that contain characters (like '*') that are not allowed in Windows 
file names.  See "Forbidden characters in filenames" at

   https://cygwin.com/cygwin-ug-net/using-specialnames.html

Internally, Cygwin converts "./*/*" to the wide char string L"*\*" with '*' 
replaced by 0xf02a.  This then gets converted to the multibyte sequence in your 
"detailed dump", which is not quite detailed enough:

$ cygpath -w "./*/*"  | od -b
0000000 357 200 252 134 357 200 252 012
0000010

I tend to agree that this is not desirable behavior.  I doubt if users of 
'cygpath -w' expect to get a result that contains transformed forbidden 
characters.  But maybe there's a use case for this that I'm missing.  Corinna?

> 0 >cygpath -wp "./*/*"         <-- but this works as expected
> *\*
> 
> Is this bug or expected behavior ?

It looks to me like a bug that 'cygpath -w' and 'cygpath -wp' give different 
results on a path that doesn't contain a colon.

Ken

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019