From: Philippe E. <ph...@us...> - 2001-10-09 20:33:40
|
Update of /cvsroot/oprofile/oprofile/pp In directory usw-pr-cvs1:/tmp/cvs-serv25600/oprofile/pp Modified Files: opf_filter.cpp Log Message: clarify doc + minor fix in pp/opf_filter.cpp Index: opf_filter.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/opf_filter.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- opf_filter.cpp 2001/10/05 22:28:03 1.26 +++ opf_filter.cpp 2001/10/09 20:33:37 1.27 @@ -451,7 +451,21 @@ exit(EXIT_FAILURE); } - if (!output_dir.empty() || !source_dir.empty()) { + if (source_dir.empty() == false) { + char* temp; + + output_separate_file = true; + + temp = opd_relative_to_absolute_path(source_dir.c_str(), NULL); + source_dir = temp; + opd_free(temp); + + if (source_dir.length() && + source_dir[source_dir.length() - 1] != '/') + source_dir += '/'; + } + + if (output_dir.empty() == false || output_separate_file == true) { char* temp; output_separate_file = true; @@ -460,19 +474,23 @@ output_dir = temp; opd_free(temp); - temp = opd_relative_to_absolute_path(source_dir.c_str(), NULL); - source_dir = temp; - opd_free(temp); + if (output_dir.length() && + output_dir[output_dir.length() - 1] != '/') + output_dir += '/'; - if (output_dir == source_dir) { - cerr << "You can not specify the same directory for " - << "--output-dir and --source-dir" << endl; + + if (create_dir(output_dir) == false) { + cerr << "unable to create " << output_dir + << " directory: " << endl; exit(EXIT_FAILURE); } + } - if (create_dir(output_dir) == false) { - cerr << "unable to create " << output_dir << " directory: " << endl; + if (output_separate_file == true) { + if (output_dir == source_dir) { + cerr << "You can not specify the same directory for " + << "--output-dir and --source-dir" << endl; exit(EXIT_FAILURE); } |