Hi Eric,

On AIX 7.1 I'm seeing this test failure:

  test-canonicalize-lgpl.c:69: assertion failed
  FAIL: test-canonicalize-lgpl

The reason is apparently a bug in realpath. Here's a test case:

================================================================================
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
  char *result;

  result = realpath ("conftest.dir", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", 
errno);

  result = realpath ("conftest.dir//.", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  result = realpath ("conftest.dir//./..", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  result = realpath ("conftest.dir/./../conftest.dir", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  result = realpath ("conftest.dir//./../conftest.dir", NULL);
  if (result != NULL) printf ("%s\n", result); else printf ("errno=%d\n", errno)
;

  return 0;
}
================================================================================
$ gcc -D_ALL_SOURCE foo.c -Wall
Output:
/home/haible/testdir1/gltests/conftest.dir
/home/haible/testdir1/gltests/conftest.dir/
/home/haible/testdir1/gltests/conftest.dir
/home/haible/testdir1/gltests/conftest.dir
errno=2

Do you think we should work around it?

Bruno
-- 
In memoriam Eduard Lederer <http://de.wikipedia.org/wiki/Eduard_Lederer>

Reply via email to