Commit f1615dcc by Alan Mishchenko

Code for parsing the transcripts.

parent 1067e6de
...@@ -1153,6 +1153,7 @@ int CmdCommandScanDir( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -1153,6 +1153,7 @@ int CmdCommandScanDir( Abc_Frame_t * pAbc, int argc, char **argv )
{ {
struct _finddata_t c_file; struct _finddata_t c_file;
char * pDirStr = NULL; char * pDirStr = NULL;
char* pDirCur = NULL;
long hFile; long hFile;
char c; char c;
...@@ -1174,8 +1175,15 @@ int CmdCommandScanDir( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -1174,8 +1175,15 @@ int CmdCommandScanDir( Abc_Frame_t * pAbc, int argc, char **argv )
goto usage; goto usage;
} }
} }
if ( pDirStr ) if ( pDirStr )
{ {
if( (pDirCur = _getcwd( NULL, 0 )) == NULL )
{
printf( "Cannot read current directory\n" );
return 0;
}
if ( _chdir(pDirStr) ) if ( _chdir(pDirStr) )
{ {
printf( "Cannot change to directory: %s\n", pDirStr ); printf( "Cannot change to directory: %s\n", pDirStr );
...@@ -1248,6 +1256,16 @@ int CmdCommandScanDir( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -1248,6 +1256,16 @@ int CmdCommandScanDir( Abc_Frame_t * pAbc, int argc, char **argv )
while( _findnext( hFile, &c_file ) == 0 ); while( _findnext( hFile, &c_file ) == 0 );
_findclose( hFile ); _findclose( hFile );
} }
if ( pDirStr )
{
if ( _chdir(pDirCur) )
{
ABC_FREE( pDirCur );
printf( "Cannot change to directory: %s\n", pDirCur );
return 0;
}
ABC_FREE( pDirCur );
}
return 0; return 0;
usage: usage:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment