From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123728 invoked by alias); 30 Jan 2016 03:21:32 -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 123719 invoked by uid 89); 30 Jan 2016 03:21:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Win32, ld, win32, ssize_t X-HELO: limerock04.mail.cornell.edu Received: from limerock04.mail.cornell.edu (HELO limerock04.mail.cornell.edu) (128.84.13.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 30 Jan 2016 03:21:30 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id u0U3LSuV016448 for ; Fri, 29 Jan 2016 22:21:28 -0500 Received: from [10.13.22.4] (50-192-26-105-static.hfc.comcastbusiness.net [50.192.26.105]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id u0U3LRNi014997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Fri, 29 Jan 2016 22:21:28 -0500 To: cygwin From: Ken Brown Subject: cygwin_conv_path sometimes removes trailing slash Message-ID: <56AC2C35.9060903@cornell.edu> Date: Sat, 30 Jan 2016 20:46:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00484.txt.bz2 I'm using cygwin_conv_path to convert Win32 paths to POSIX paths, and I'm puzzled by the conversion d:/ --> /cygdrive/d without the trailing slash. By contrast, we have d:/foo/ --> /cygdrive/d/foo/ Is the removal of the trailing slash in the first example a deliberate design decision? I find it counter-intuitive. My tests are essentially based on the example at the end of https://cygwin.com/cygwin-api/func-cygwin-conv-path.html: #include #include #include int main () { wchar_t *win32 = L"d:/"; ssize_t size; char *posix; size = cygwin_conv_path (CCP_WIN_W_TO_POSIX, win32, NULL, 0); if (size < 0) perror ("cygwin_conv_path"); else { posix = (char *) malloc (size); if (cygwin_conv_path (CCP_WIN_W_TO_POSIX, win32, posix, size)) perror ("cygwin_conv_path"); } printf ("%s\n", posix); } Ken -- 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