From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72478 invoked by alias); 6 Oct 2016 20:47:50 -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 72464 invoked by uid 89); 6 Oct 2016 20:47:49 -0000 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 Received: from mail-it0-f52.google.com (HELO mail-it0-f52.google.com) (209.85.214.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Oct 2016 20:47:39 +0000 Received: by mail-it0-f52.google.com with SMTP id o19so41749915ito.1 for ; Thu, 06 Oct 2016 13:47:39 -0700 (PDT) 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 Received: by 10.64.105.195 with HTTP; Thu, 6 Oct 2016 13:47:17 -0700 (PDT) In-Reply-To: <87zimhp9df.fsf@Rainer.invalid> References: <87zimhp9df.fsf@Rainer.invalid> From: Andre Maroneze Date: Thu, 06 Oct 2016 22:57:00 -0000 Message-ID: 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 X-SW-Source: 2016-10/txt/msg00081.txt.bz2 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 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