This is the mail archive of the cygwin-developers@sources.redhat.com 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]

chdir problem


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



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