This is the mail archive of the cygwin-apps mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygpath 1.7 wrong

On Jun 13 17:01, Reini Urban wrote:
> Corinna Vinschen schrieb:
>> On Jun 13 15:03, Reini Urban wrote:
>>> 1.5$ perl -e'print Cygwin::mount_flags("/cygdrive")'
>>> binmode,cygdrive,/cygdrive
>>> 1.7$ perl -e'print Cygwin::mount_flags("/cygdrive")'
>>> binmode,cygdrive,/cygdrive/
>> Doesn't work for me:
>>   1.7$ perl -e'print Cygwin::mount_flags("/cygdrive")'
>>   Undefined subroutine &Cygwin::mount_flags called at -e line 1.
>> How does a standalone example look like?
> Sorry, this perl is perl5.10.0-4 from [Exp].
> Also I recompiled it for cygwin-1.7 with the wchar support. (returning utf8 
> converted from wchar)
> perl5.8.8 doesn't has this function yet.
> Something like:

Thanks.  Is that the function implemented in Perl?  If so, I'd have
two comments:

> #include <stdlib.h>
> #include <stdio.h>
> #include <sys/cygwin.h>
> char *Cygwin_mount_flags(char *pathname) {
>     char flags[260]; /* I know, I know. stack vs heap */
>     /* TODO: Check for cygdrive registry setting,
>      *       and then use CW_GET_CYGDRIVE_INFO
>      */

Drop that TODO.  Never test the registry, not even in 1.5, even less
in 1.7.

>     if (!strcmp(pathname, "/cygdrive")) {
> 	char user[260];
> 	char system[260];
> 	char user_flags[260];
> 	char system_flags[260];

The paths in user and system are potentially PATH_MAX bytes long.
That's 4K in 1.7.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]