This is the mail archive of the cygwin-patches 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: Add _PC_CASE_INSENSITIVE flag to pathconf


On Oct 20 15:54, Ken Brown wrote:
> Patch attached.
> 
> I tested it by running getconf.exe, and also as follows:
> 
> $ cat case_sens_test.c
> #include <unistd.h>
> #include <stdio.h>
> 
> void
> test (const char *path)
> {
>   int ret = pathconf (path, _PC_CASE_INSENSITIVE);
>   printf ("pathconf (\"%s\", _PC_CASE_INSENSITIVE) returns %d\n", path,
> ret);
>   if (ret == -1)
>     perror ("  pathconf");
> }
> 
> int
> main ()
> {
>   test ("/tmp");
>   test ("/tmp/a");
>   test ("/cygdrive/c/cygwin");
>   test ("/");
>   test (".");
> }
> 
> $ gcc case_sens_test.c
> 
> $ ./a
> pathconf ("/tmp", _PC_CASE_INSENSITIVE) returns 0
> pathconf ("/tmp/a", _PC_CASE_INSENSITIVE) returns -1
>   pathconf: No such file or directory
> pathconf ("/cygdrive/c/cygwin", _PC_CASE_INSENSITIVE) returns 1
> pathconf ("/", _PC_CASE_INSENSITIVE) returns 0
> pathconf (".", _PC_CASE_INSENSITIVE) returns 0
> 
> This test was done, obviously, on a system with the obcaseinsensitive
> registry key set to 0, and with /tmp/a non-existent.  I also tested with the
> registry key set to 1, with the expected results.
> 
> Ken

Thanks Ken.  Patch applied.


Corinna

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

Attachment: signature.asc
Description: PGP signature


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