public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andre Maroneze <maroneze@gmail.com>
To: cygwin@cygwin.com
Subject: Re: cygpath 2.6.0: -m " C:" and garbled output
Date: Thu, 06 Oct 2016 22:57:00 -0000	[thread overview]
Message-ID: <CAFKkpzp8a_JRk8j5=o6uJUG3hxVLPsFV_0_spifFEXCOf=fbEA@mail.gmail.com> (raw)
In-Reply-To: <87zimhp9df.fsf@Rainer.invalid>

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

      reply	other threads:[~2016-10-06 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 14:51 Andre Maroneze
2016-10-06 19:26 ` Ken Brown
2016-10-06 20:47 ` Achim Gratz
2016-10-06 22:57   ` Andre Maroneze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFKkpzp8a_JRk8j5=o6uJUG3hxVLPsFV_0_spifFEXCOf=fbEA@mail.gmail.com' \
    --to=maroneze@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).