static char*
tr_getcwd( void )
{
+ char * result;
char buf[2048];
*buf = '\0';
#ifdef WIN32
- _getcwd( buf, sizeof( buf ) );
+ result = _getcwd( buf, sizeof( buf ) );
#else
- getcwd( buf, sizeof( buf ) );
+ result = getcwd( buf, sizeof( buf ) );
#endif
+ if( result == NULL )
+ fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
return tr_strdup( buf );
}
* $Id$
*/
+#include <errno.h>
#include <stdio.h>
#include <unistd.h> /* getcwd() */
static char*
tr_getcwd( void )
{
+ char * result;
char buf[2048];
*buf = '\0';
#ifdef WIN32
- _getcwd( buf, sizeof( buf ) );
+ result = _getcwd( buf, sizeof( buf ) );
#else
- getcwd( buf, sizeof( buf ) );
+ result = getcwd( buf, sizeof( buf ) );
#endif
+ if( result == NULL )
+ fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
return tr_strdup( buf );
}