X-Recipient: archive-cygwin@delorie.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:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=oebRhU8
	vWPOW/4Ni9p42HB6ohpn4BlffLG7elRhaQjGrjCAFkdvqAGfGFCgpK4S1IlUfEOM
	thdyeCMBOrl8BC1k1TuMq/slxOED9W6jLtq3T3k9h+j0lZkH9s25xNeNwp6JtA5K
	T7y1jEiKN9tZkMes23fzP1tbcnyrYPjG4vio=
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:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; s=default; bh=xXB0+HHtN5bvx
	PuQCcLipfnYI+E=; b=eJg4gNFBxrYLSAgssGx6JWqXSfnH5w3NhKDq0ov/3up5J
	OvfmrOx2zVeYtzmHqCam6YPh3qwrdiJ9atu+OHfmn7sqDGAd1d/HrTM0d5fedffm
	X71L174QtSdgYNJPugYkgLRjGHh9KY0KvoJjlX3BBBkfo/BEBd3iKSgMUDQSBc=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=U*Stromeko, sk:Stromek, sk:stromek, stromekonexgode
X-HELO: mail-it0-f52.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=x-gm-message-state:mime-version:in-reply-to:references:from:date         :message-id:subject:to;        bh=fDT3emKgvXQcqepHRDMWUFuAqRVvNV3jMzwcAjxioRA=;        b=JAq+PG4ui8HKMcmCYU5xAPaFfqySs+v7f0Wv9+xfgNDE+MzG7vJG5LXnwZtBkmuMKa         i/MayNMG8fkVeuGzjiZmyskyZGUeJfg8TAhqQ2tEo0z9iioiI3cVwOWaXC/Hg+xTaZGO         XKB9ZaOxEL4ZBXA3ER7BdWSwFS9cThnFkqYOTOhZnc+akAzKqD9LoPnTl1N2i0oQa7Ne         FDLdGXzmCAT2Wx5eZizgFEJwXs3vPMonTX1dhkNSFjAJpdVAjbh0Qi0dCpqIuiIu+cy7         O9pJoXhqt18pOlYIWXfa+HtgFzgdaD6LwlyDoymUyvHpPYg2lUThqUSi4SvkuyJWyyH/         eoDQ==
X-Gm-Message-State: AA6/9RlCzxaWQoJE4qOwptB+oCayOtd+BhnIrbzfM3QJFwvSBdArFlMdw8sFRcQBFWmNs7FBgjKAnS5TiacXkQ==
X-Received: by 10.36.210.70 with SMTP id z67mr34507957itf.67.1475786857607; Thu, 06 Oct 2016 13:47:37 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <87zimhp9df.fsf@Rainer.invalid>
References: <CAFKkpzpSu7bOCKf3uAwHrEiHcs5M9RCzVV4o2V=Lpo7PrgnGJg@mail.gmail.com> <87zimhp9df.fsf@Rainer.invalid>
From: Andre Maroneze <maroneze@gmail.com>
Date: Thu, 6 Oct 2016 22:47:17 +0200
Message-ID: <CAFKkpzp8a_JRk8j5=o6uJUG3hxVLPsFV_0_spifFEXCOf=fbEA@mail.gmail.com>
Subject: Re: cygpath 2.6.0: -m " C:" and garbled output
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes

Just to clarify, " C:" is not the entire filepath I was giving to
cygpath, it's more like " C:/Temp/a.txt", but I reduced to it when
trying to isolate the difference between versions.

On Thu, Oct 6, 2016 at 9:26 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> A filename can legitimately start with a space and it is a relative filename in that case.  So dropping the space just to get something that looks like a drive letter is wrong.

Indeed! I hadn't thought it that way, and it nicely explains why no
conversion happens without the space (in which case it would be
considered an absolute file path, despite starting with "C:").

> That's how the otherwise forbidden ":" character gets encoded into the filename.

I do know that ":" is forbidden in a filename, but because I (assumed
I) was giving it a file path (and one which was supposed to be
absolute), I didn't consider that the rules about special filenames
would apply. But having a relative file path changes everything.

>> In cygpath 2.5.2 (and 2.4.1, which I also could test), it outputs C:, as I would expect.
>
> No, that's wrong as explained above.

I should have said, "as I got used to expect due to past behavior". I
would guess those versions were more lenient towards absolute file
paths, which would however be an issue for filenames starting with
spaces.

Thanks to both of you for the clarifications. In the end, the extra
whitespace was incorrectly inserted by a makefile function call, so I
fixed it anyway, but I wanted to fully understand the issue to avoid
incurring into similar problems later.

--
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

