ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DUFF.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/DUFF.cpp (file contents):
Revision 1650 by gezelter, Tue Oct 26 22:24:52 2004 UTC vs.
Revision 1653 by gezelter, Wed Oct 27 00:01:29 2004 UTC

# Line 454 | Line 454 | DUFF::DUFF(){
454  
455   DUFF::DUFF(){
456  
457 <  char fileName[200];
458 <  char* ffPath_env = "FORCE_PARAM_PATH";
459 <  char* ffPath;
460 <  char temp[200];
457 >  string fileName;
458 >  string tempString;
459  
460    headAtomType       = NULL;
461    currentAtomType    = NULL;
# Line 567 | Line 565 | DUFF::DUFF(){
565      
566      // generate the force file name
567      
568 <    strcpy( fileName, "DUFF.frc" );
568 >    fileName = "DUFF.frc";
569      //    fprintf( stderr,"Trying to open %s\n", fileName );
570      
571      // attempt to open the file in the current directory first.
572      
573 <    frcFile = fopen( fileName, "r" );
573 >    frcFile = fopen( fileName.c_str(), "r" );
574      
575      if( frcFile == NULL ){
576        
577        // next see if the force path enviorment variable is set
578 <      
579 <      ffPath = getenv( ffPath_env );
580 <      if( ffPath == NULL ) {
581 <        STR_DEFINE(ffPath, FRC_PATH );
582 <      }
585 <      
586 <      
587 <      strcpy( temp, ffPath );
588 <      strcat( temp, "/" );
589 <      strcat( temp, fileName );
590 <      strcpy( fileName, temp );
591 <      
592 <      frcFile = fopen( fileName, "r" );
578 >
579 >      tempString = ffPath + "/" + fileName;
580 >      fileName = tempString;
581 >            
582 >      frcFile = fopen( fileName.c_str(), "r" );
583        
584        if( frcFile == NULL ){
585          
# Line 598 | Line 588 | DUFF::DUFF(){
588                   "\t%s\n"
589                   "\tHave you tried setting the FORCE_PARAM_PATH environment "
590                   "variable?\n",
591 <                 fileName );
591 >                 fileName.c_str() );
592          painCave.severity = OOPSE_ERROR;
593          painCave.isFatal = 1;
594          simError();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines