delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/04/23/04:45:14

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=d5X9z+BjhHAHIaIP7d6VOCH3pcpy5X2NuefTHr+dFfGkQA4y1Sy/J
P3EZZCLG6h8kQvDFu4u9A9LbU2qk6FntJR01iq0fvXNMqPHxYtnYSdKPLPndkdEx
k/nK76OT7MMoGDxKdijy7GCwTPfMR2Zz18LoX96oTpEtZL0iHRTHKA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=Dl5BNcZoCbEPonnMKMsOPD3jzD4=; b=UCXontMtOsZoX988+x8x42QKMwYN
3fMy5NJOJKmyoxjIwaX0zM4gqAL8T++n/2qW+GRqYqEkWI9xzCrXjmGPwRBUU65m
N8QSgCb64+gXy6gQFmXc7OiHkb9+qAAanhxgBjKREM6yyxj/8CcxwlSU7AXZybd8
/PYRn45pIiYeOSc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-101.7 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=suffer, Hat, macek, Sounds
X-HELO: mout.kundenserver.de
Date: Mon, 23 Apr 2018 10:44:51 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Fails to launch batch script in some directories
Message-ID: <20180423084451.GT15911@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Alexpux/MSYS2-packages/issues/1225 AT github DOT com> <76873039-f459-5534-ce8a-bb8fcbd35274 AT gmail DOT com> <20180420131111 DOT GS15911 AT calimero DOT vinschen DOT de> <2325202b-1fb7-dbc9-9738-8934d3949fcb AT SystematicSw DOT ab DOT ca> <71792648-0698-e407-ac67-244ddab446b3 AT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <71792648-0698-e407-ac67-244ddab446b3@gmail.com>
User-Agent: Mutt/1.9.2 (2017-12-15)
X-UI-Out-Filterresults: notjunk:1;V01:K0:ezggHfbn++A=:+M7P6lq41wGgeTwaTQvjWq kCMUrnznaCuUKyVsERP8Lwx9x6umMvfn64FxW3tBGdMj/FB2aWLiThc0LFngnNgq9ubX1zlCZ 0wNgmj4O7ojFiawHnvU/PX2x6OHbA66jMqPNLQrCehXDdyTtyrCWEDRtdhj6GWuwBnz3xkFf5 FpvcnXHA3UqXf2N+ZiJvZKbXzFRLbnJkKFUUzFrR3Z5+pADrZ1e7ZFlqZHSLQ/us/6uLWJGo9 6RMtd87Qd6xj/KACS0KATc/3L6ZiLprNWgV6io74TAu8jN+NLNRerkpQ9ovE9as83aQyGnwW8 D3VgigiW00BqEpeVW+qsTgSxdb5LShSRClhdNeRI7l2FtBVmxeURe5wla8cPC1dI9tEqTKqUL VhW8DP6EAadp0O83DQu5sTnPzK8c4rguk0bOlz/sbItBja7xLDGpxfrGNABM0iObST4OimIQn /v0mjP9gT6AyHFn0aj0H71tLOA5tyhYilOiMkLoELpbgB9A/u0OVx5z0PRUbtL2BThgyUZUEs fEoBwWOcoRZ5foZRl2tGax8EDnQcP3pbu46L3EEH8d12OKDKcSMSnvuoLzajFxMEABiXLMJii 4P3d+TQVltBOAdpqlPtJelhhMf28pRbU17WlDuKdTVs+xEfmqTw0I09oyMAD3HMvIFm3X+t6V FEADpWselEaeKkc93vPQC91fwg7z549QRreaHMh7Q6Q8o0NRNZTowez9JCkI/unQ7Gmtyfd6P M1gFhc8dHgiAki+JYlgPuVokR7wqLMZnxROt6g==

--tKy6e3LXpfmanBFM
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Apr 23 08:43, David Macek wrote:
> On 21. 4. 2018 17:38, Brian Inglis wrote:
> > See my other post in this thread where strace shows @ handling is not i=
nvolved,
> > as the script directory and name are normalized and converted to a win3=
2 path
> > correctly, but child_info_spawn::worker does not appear to quote args w=
ith
> > spaces (or apostrophes) when building the command line, despite the com=
ment near
> > the top of the function.
>=20
> Do you have a test case for this?  In my testing, paths with spaces (like=
 'x y' instead of '@ x') work just fine.

Brian has a point though.  It's not a space *in* a filename, it's a
*trailing* space.  And that points to the cause of the problem:

Paths with trailing spaces are invalid DOS paths.

Try this:

  bash$ mkdir "x "
  bash$ cmd
  C:\...>cd "x "
  cd "x "
  The system cannot find the path specified.

The problem is not exactly in Cygwin, it's the good old fact that Win32
tools using the WIn32 file API just can't accfess the file because they
don't see it.  The Win32 API simply deletes trailing spaces from
filenames, in and out.

Cygwin doesn't suffer this problem because it uses the underlying NT API.

https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialc=
hars

The only workaround from Cygwin's side would be to convert 0x20 spaces
to 0xf020 characters as the other invalid chars as outlined in the above
URL.  However, this would only be ok for trailing spaces, given that
leading or in-between spaces are perfectly valid.  Sounds kind of
error prone.

IMHO, better leave it as is and tell the user.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--tKy6e3LXpfmanBFM
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlrdnQMACgkQ9TYGna5E
T6AfrA/9GN43rhtZkciEGehAix3U7sga1T+yR41pdDUfi9IEaPBtnQQUMAV6L+4Z
1plVeZ1U+Vzn6N55aUeHSKpatZtoiVzRWekvHeGwSJLreD9NhMYdbL4PZDAFf8qN
zQ0/1d4pKnDYiIPMhMxWN71jbV7d04dGWzURS+pQDJjPmlp7a/QFPwkrql0D+lWq
8+Ig5qMdaB+SSGYFP7kunjwsPpg627CzcDDxE3ZVCUNv8DVPlBu1cnErgqBVVk3J
A4jCb/bikP9z9pJP4bG99joBgqx5Nhnh/P4OdH6gZPh4BqxnP5OjKDwHiUhn5Lri
Sx6pDpBSgiZe2p6zXdQdwGmyDDVk59pyIrYwdPYHkrvqAaHDUI12FtNINBdseU98
KWHShV8W6jiOFATFnnLA6rqFTNWylmOiT85y4PMHvZ6S1OM004WfHFdDlNpBGBPH
bvdcNlvU0rMsf3tDuetPihxxpbvGsoRZfO4JaZZoHXlZTJ/2o5TfFmTTg3FvvS8o
4ZCbZwrpZP8nH/CtuILxQ9HQiDqL1gpTWrzevSEUWo6hzOpVW/txZ0qgkWl77jiY
y0S52PM5KUlxfBs6sRiEvxOvIUbzHtfQl18EwhJGwYnIesy4B/TCShIjRdf+7+GO
40n3+H9o+JN/UY6xHeSIbwWo/++uVqJgXk8+G5Xc4zMDIzEnOik=
=+Qi3
-----END PGP SIGNATURE-----

--tKy6e3LXpfmanBFM--

- Raw text -


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