From 30708ff4bc2cbe960ec62762c80c2f3218df35c6 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sat, 14 Jan 2017 11:44:35 +0100 Subject: [PATCH] fixed problem with full path-file-name. --- src/dump_header.cpp | 13 ++++++++++--- src/musredit/PTextEdit.cpp | 1 + src/musredit_qt5/PTextEdit.cpp | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dump_header.cpp b/src/dump_header.cpp index f6affbac..74d6a64b 100644 --- a/src/dump_header.cpp +++ b/src/dump_header.cpp @@ -929,13 +929,20 @@ int main(int argc, char *argv[]) } bool found_fln = false; - // 1st check if the file name is found in the current directory string pathFln(""); - pathFln = "./" + fileName; + // 1st check if the file name is the full path-file name and the file exists + pathFln = fileName; if (dump_file_exists(pathFln)) found_fln = true; - // 2nd check if file name is found in any default search paths if not already found in the current directory + // 2nd check if the file name is found in the current directory + if (!found_fln) { + pathFln = "./" + fileName; + if (dump_file_exists(pathFln)) + found_fln = true; + } + + // 3rd check if file name is found in any default search paths if not already found in the current directory if (!found_fln) { PStringVector pathList = startupHandler->GetDataPathList(); for (unsigned int i=0; i cmd; QString str = fAdmin->getExecPath() + "/dump_header"; cmd.append(str); + cmd.append("-fn"); cmd.append(fileName); PDumpOutputHandler dumpOutputHandler(cmd); diff --git a/src/musredit_qt5/PTextEdit.cpp b/src/musredit_qt5/PTextEdit.cpp index 51a382db..22c7b8ec 100644 --- a/src/musredit_qt5/PTextEdit.cpp +++ b/src/musredit_qt5/PTextEdit.cpp @@ -2488,6 +2488,7 @@ void PTextEdit::musrDump() QVector cmd; QString str = fAdmin->getExecPath() + "/dump_header"; cmd.append(str); + cmd.append("-fn"); cmd.append(fileName); PDumpOutputHandler dumpOutputHandler(cmd);