This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
chdir problem
- To: cygwin-developers at sourceware dot cygnus dot com
- Subject: chdir problem
- From: Egor Duda <deo at logos-m dot ru>
- Date: Mon, 11 Sep 2000 19:14:32 +0400
- Organization: DEO
- Reply-To: Egor Duda <cygwin-developers at sourceware dot cygnus dot com>
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