Add _PC_CASE_INSENSITIVE flag to pathconf
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Oct 21 11:39:00 GMT 2016
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20161021/582e642f/attachment.sig>
More information about the Cygwin-patches
mailing list