summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>1999-12-15 19:39:36 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>1999-12-15 19:39:36 (GMT)
commitdc2968f7b44b1a219a0695ba80c63cd0d7da0ef1 (patch)
tree46bbaf2d590cf1e2edf1bc86a8d7000a2012dc0d /src/util.cpp
parent916d6d5c6f6c9d14c4c9a636582671c81447f54a (diff)
downloadDoxygen-dc2968f7b44b1a219a0695ba80c63cd0d7da0ef1.zip
Doxygen-dc2968f7b44b1a219a0695ba80c63cd0d7da0ef1.tar.gz
Doxygen-dc2968f7b44b1a219a0695ba80c63cd0d7da0ef1.tar.bz2
mods for doxygen-0.49-991117
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 24bf683..4be1a7e 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -320,8 +320,8 @@ void writeExample(OutputList &ol,ExampleList *el)
QCString exampleLine=theTranslator->trWriteList(el->count());
bool latexEnabled = ol.isEnabled(OutputGenerator::Latex);
- bool manEnabled = ol.isEnabled(OutputGenerator::Html);
- bool htmlEnabled = ol.isEnabled(OutputGenerator::Man);
+ bool manEnabled = ol.isEnabled(OutputGenerator::Man);
+ bool htmlEnabled = ol.isEnabled(OutputGenerator::Html);
QRegExp marker("@[0-9]+");
int index=0,newIndex,matchLen;
// now replace all markers in inheritLine with links to the classes
@@ -624,21 +624,25 @@ QCString fileToString(const char *name)
QFileInfo fi(name);
if (!fi.exists() || !fi.isFile())
{
- err("Error: file `%s' not found\n",name);
- exit(1);
+ warn("Error: file `%s' not found\n",name);
+ return "";
}
f.setName(name);
fileOpened=f.open(IO_ReadOnly);
}
if (!fileOpened)
{
- err("Error: cannot open file `%s' for reading\n",name);
- exit(1);
+ warn("Error: cannot open file `%s' for reading\n",name);
+ return "";
}
int fsize=f.size();
- QCString contents(fsize+1);
+ QCString contents(fsize+2);
f.readBlock(contents.data(),fsize);
- contents[fsize]='\0';
+ if (fsize==0 || contents[fsize-1]=='\n')
+ contents[fsize]='\0';
+ else
+ contents[fsize]='\n';
+ contents[fsize+1]='\0';
f.close();
return contents;
}