Changeset 7b1cea for molecuilder/src/config.cpp
- Timestamp:
- Apr 29, 2008, 7:04:59 AM (18 years ago)
- Children:
- 2456db
- Parents:
- 36b128
- File:
-
- 1 edited
-
molecuilder/src/config.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/config.cpp
r36b128 r7b1cea 17 17 pseudopotpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname"); 18 18 configpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname"); 19 configname = (char *) MallocString(sizeof(char)*255,"config constructor: mainname"); 19 20 strcpy(mainname,"pcp"); 20 21 strcpy(defaultpath,"not specified"); … … 88 89 Free((void **)&pseudopotpath, "config::~config: *pseudopotpath"); 89 90 Free((void **)&configpath, "config::~config: *configpath"); 91 Free((void **)&configname, "config::~config: *configname"); 90 92 }; 91 93 … … 406 408 * \param *filename config file string 407 409 */ 408 void config::RetrieveConfigPath (char *filename)410 void config::RetrieveConfigPathAndName(char *filename) 409 411 { 412 char *ptr = NULL; 410 413 int last = -1; 411 414 for(int i=0;i<255;i++) { … … 417 420 if (last == -1) { // no path in front, set to local directory. 418 421 strcpy(configpath, "./"); 422 ptr = filename; 419 423 } else { 420 424 strncpy(configpath, filename, last+1); 425 ptr = &filename[last+1]; 421 426 if (last < 254) 422 427 configpath[last+1]='\0'; 423 428 } 424 cout << "Found configpath: " << configpath << ", dir slash was found at " << last << "." << endl; 429 strcpy(configname, ptr); 430 cout << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl; 425 431 }; 426 432 … … 438 444 return; 439 445 } 440 RetrieveConfigPath (filename);446 RetrieveConfigPathAndName(filename); 441 447 // ParseParameters 442 448 … … 669 675 return; 670 676 } 671 RetrieveConfigPath (filename);677 RetrieveConfigPathAndName(filename); 672 678 // ParseParameters 673 679
Note:
See TracChangeset
for help on using the changeset viewer.
