Skip to content

Commit f5e6c90

Browse files
committed
bug_792690 Spaces MAKEINDEX_CMD_NAME don't work the same as other config options
The PDF generation in doxygen uses a 2 stage process: - generate the tex files - build (outside of doxygen!) the PDF file by means of the supplied `Makefile` / `make.bat` this is another way than it happens for e.g. generating images where the external process is directly called from within doxygen, and here the path is quoted by doxygen (see `Portable::system) when necessary. This discrepancy has been fixed.
1 parent 68710b9 commit f5e6c90

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/latexgen.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ static void writeLatexMakefile()
295295
}
296296
TextStream t(&f);
297297
// inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05
298-
QCString latex_command = theTranslator->latexCommandName();
299-
QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME);
298+
QCString latex_command = escapePath(theTranslator->latexCommandName());
299+
QCString mkidx_command = escapePath(Config_getString(MAKEINDEX_CMD_NAME));
300300
// end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05
301301
if (!Config_getBool(USE_PDFLATEX)) // use plain old latex
302302
{
@@ -383,8 +383,8 @@ static void writeMakeBat()
383383
#if defined(_MSC_VER)
384384
QCString dir=Config_getString(LATEX_OUTPUT);
385385
QCString fileName=dir+"/make.bat";
386-
QCString latex_command = theTranslator->latexCommandName();
387-
QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME);
386+
QCString latex_command = escapePath(theTranslator->latexCommandName());
387+
QCString mkidx_command = escapePath(Config_getString(MAKEINDEX_CMD_NAME));
388388
bool generateBib = !CitationManager::instance().isEmpty();
389389
std::ofstream t(fileName.str(),std::ofstream::out | std::ofstream::binary);
390390
if (!t.is_open())

src/util.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7381,3 +7381,16 @@ QCString integerToRoman(int n, bool upper)
73817381

73827382
return result;
73837383
}
7384+
7385+
QCString escapePath(QCString s)
7386+
{
7387+
if (s.isEmpty()) return s;
7388+
QCString str = s;
7389+
str=str.stripWhiteSpace();
7390+
if (str.at(0)!='"' && str.find(' ')!=-1)
7391+
{
7392+
// add quotes around command as it contains spaces and is not quoted already
7393+
str="\""+str+"\"";
7394+
}
7395+
return str;
7396+
}

src/util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,4 +430,5 @@ FortranFormat convertFileNameFortranParserCode(QCString fn);
430430
QCString integerToAlpha(int n, bool upper=true);
431431
QCString integerToRoman(int n, bool upper=true);
432432

433+
QCString escapePath(QCString s);
433434
#endif

0 commit comments

Comments
 (0)