chdir problem

Egor Duda deo@logos-m.ru
Mon Sep 11 08:15:00 GMT 2000


Hi!

  the following code:

========================================================================
#include <stdio.h>
#include <unistd.h>
#include <windows.h>

main()
{
  int rc;
  char cwd [ MAX_PATH + 1 ];
  bzero ( cwd,  sizeof ( cwd ) );
  if ( ( rc = chdir ( "/tmp" ) ) != 0 ) perror ( "chdir 1" );
  if ( ( rc = chdir ( "." ) ) != 0 ) perror ( "chdir 2" );
  if ( ( rc = chdir ( ".." ) ) != 0 ) perror ( "chdir 3" );
  getcwd ( cwd, sizeof ( cwd ) - 1 );
  printf ( "%s", cwd );
} ;
========================================================================

prints '/tmp' instead of '/'

i     suspect   that it should be fixed in normalize_posix_path(), but
i'm  not  ready  to  propose a patch until i understand fully how this
function works. Chris, would you take a look at this?

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19




More information about the Cygwin-developers mailing list