delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/01/29/07:34:09

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 29 Jan 2011 13:33:49 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com, bug-gnu-libiconv AT gnu DOT org
Subject: Re: Bug in libiconv?
Message-ID: <20110129123349.GB8671@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com, bug-gnu-libiconv AT gnu DOT org
Mail-Followup-To: cygwin AT cygwin DOT com, bug-gnu-libiconv AT gnu DOT org
References: <201101282312 DOT 50298 DOT bruno AT clisp DOT org> <4D438432 DOT 3070906 AT cwilson DOT fastmail DOT fm>
MIME-Version: 1.0
In-Reply-To: <4D438432.3070906@cwilson.fastmail.fm>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Jan 28 22:06, Charles Wilson wrote:
> On 1/28/2011 5:12 PM, Bruno Haible wrote:
> >> the old cygwin_conv_to_posix_path function as well.
> > 
> > Is cygwin_conv_to_posix_path deprecated? Does it introduce limitations of
> > some kind?
> 
> Yes, and (and because:) yes.
> 
> The limitation is, the old functions:
> 
> extern int cygwin_win32_to_posix_path_list (const char *, char *)
> extern int cygwin_win32_to_posix_path_list_buf_size (const char *)
> extern int cygwin_posix_to_win32_path_list (const char *, char *)
> extern int cygwin_posix_to_win32_path_list_buf_size (const char *)
> extern int cygwin_conv_to_win32_path (const char *, char *)
> extern int cygwin_conv_to_full_win32_path (const char *, char *)
> extern int cygwin_conv_to_posix_path (const char *, char *)
> extern int cygwin_conv_to_full_posix_path (const char *, char *)
> 
> are all deprecated, because (a) they don't handle wide chars, (b) and
> are limited to only 254 char path lengths.  The replacement functions
> 
> extern ssize_t cygwin_conv_path (cygwin_conv_path_t what,
>                                  const void *from,
>                                  void *to, size_t size);
> 
> extern ssize_t cygwin_conv_path_list (cygwin_conv_path_t what,
>                                       const void *from,
>                                       void *to, size_t size);
> 
> extern void *cygwin_create_path (cygwin_conv_path_t what,
>                                  const void *from);
> 
> do not have these limitations (well, 4Kbytes/2k wchars for a single
> filename; 32K? for pathlists).  cygwin_conv_path_t controls the
> behavior, and can accept the following values:

Cygwin defines PATH_MAX == 4096 since we don't guarantee that an
incoming filename of more than 4K is handled.  However, the conversion
itself does not restrict what we get from Windows, which is 32K
pathnames.

> However, by using the linux-ish facilities throughout and avoiding the
> win32 stuff, you can ALSO avoid the necessity of calling any path
> conversion functions at all -- and eliminate a lot of platform-specific
> code.  (e.g. let the cygwin dll do ALL the work)

Exactly.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


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