From 48676b42611b981c1845c7426f22422b9d94cb13 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 6 Sep 2013 20:33:04 +0200 Subject: Bug 707554 - When I use @INCLUDE DoxyWizard is closed Current directory was not changed at the right time so the include files could not be found in the "current" directory (i.e. the directory where the Doxyfile resides too, as this directory is shown as the current directory in the doxywizard). This is also important when the doxywizard is started from a shortcut. --- addon/doxywizard/doxywizard.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index 11bd8f2..ce764e0 100644 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -224,9 +224,13 @@ void MainWindow::updateConfigFileName(const QString &fileName) void MainWindow::loadConfigFromFile(const QString & fileName) { - m_expert->loadConfig(fileName); - m_wizard->refresh(); + // save full path info of original file + QString absFileName = QFileInfo(fileName).absoluteFilePath(); + // updates the current directory updateConfigFileName(fileName); + // open the specified configuration file + m_expert->loadConfig(absFileName); + m_wizard->refresh(); updateLaunchButtonState(); m_modified = false; updateTitle(); -- cgit v0.12 From 2e03209d4579b239ce5abe59c8cd2a0fe7086ea0 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 7 Sep 2013 16:03:07 +0200 Subject: Bug 707685 - Fortran: error message when missing last EOL In case the original buffer in either fixed or free format code does not contain an EOL as last character, add it. --- src/fortranscanner.l | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/fortranscanner.l diff --git a/src/fortranscanner.l b/src/fortranscanner.l old mode 100644 new mode 100755 index c6b47d3..6d64cb9 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -1366,7 +1366,7 @@ static const char* prepassFixedForm(const char* contents) int prevLineLength=0; int prevLineAmpOrExclIndex=-1; bool emptyLabel=TRUE; - int newContentsSize = strlen(contents)+2; // \000 and one spare character (to avoid reallocation) + int newContentsSize = strlen(contents)+3; // \000, \n (when necessary) and one spare character (to avoid reallocation) char* newContents = (char*)malloc(newContentsSize); for(int i=0, j=0;;i++,j++) { @@ -1390,6 +1390,14 @@ static const char* prepassFixedForm(const char* contents) break; case '\000': newContents[j]='\000'; + newContentsSize = strlen(newContents); + if (newContents[newContentsSize - 1] != '\n') + { + // to be on the safe side + newContents = (char*)realloc(newContents, newContentsSize+2); + newContents[newContentsSize] = '\n'; + newContents[newContentsSize + 1] = '\000'; + } return newContents; case 'C': case 'c': @@ -1425,6 +1433,15 @@ static const char* prepassFixedForm(const char* contents) break; } } + + newContentsSize = strlen(newContents); + if (newContents[newContentsSize - 1] != '\n') + { + // to be on the safe side + newContents = (char*)realloc(newContents, newContentsSize+2); + newContents[newContentsSize] = '\n'; + newContents[newContentsSize + 1] = '\000'; + } return newContents; } @@ -2228,6 +2245,7 @@ level--; static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) { + char *tmpBuf = NULL; initParser(); defaultProtection = Public; @@ -2258,6 +2276,14 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) //clock_t end=clock(); //printf("CPU time used=%f\n", ((double) (end-start))/CLOCKS_PER_SEC); } + else if (inputString[strlen(fileBuf)-1] != '\n') + { + tmpBuf = (char *)malloc(strlen(fileBuf)+2); + strcpy(tmpBuf,fileBuf); + tmpBuf[strlen(fileBuf)]= '\n'; + tmpBuf[strlen(fileBuf)+1]= '\000'; + inputString = tmpBuf; + } yyLineNr= 1 ; yyFileName = fileName; @@ -2291,6 +2317,10 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) rt->program.resize(0); delete current; current=0; moduleProcedures.clear(); + if (tmpBuf) { + free((char*)tmpBuf); + inputString=NULL; + } if (isFixedForm) { free((char*)inputString); inputString=NULL; -- cgit v0.12