Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
84f83537
Commit
84f83537
authored
Jul 14, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed extra newline when reading in an input file
parent
eda06377
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
55 deletions
+1
-55
util.cpp
src/util.cpp
+1
-55
No files found.
src/util.cpp
View file @
84f83537
...
...
@@ -2432,60 +2432,6 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode)
}
return
buf
.
data
();
}
#if 0
QCString filterName = getFileFilter(name,isSourceCode);
if (filterName.isEmpty() || !filter)
{
f.setName(name);
fileOpened=f.open(IO_ReadOnly);
if (fileOpened)
{
int fsize=f.size();
QCString contents(fsize+2);
f.readBlock(contents.data(),fsize);
if (fsize==0 || contents[fsize-1]=='\n')
contents[fsize]='\0';
else
contents[fsize]='\n'; // to help the scanner
contents[fsize+1]='\0';
f.close();
int newSize = filterCRLF(contents.data(),fsize+2);
if (newSize!=fsize+2)
{
contents.resize(newSize);
}
return transcodeCharacterStringToUTF8(contents);
}
}
else // filter the input
{
QCString cmd=filterName+" \""+name+"\"";
Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data());
FILE *f=portable_popen(cmd,"r");
if (!f)
{
err("could not execute filter %s\n",filterName.data());
return "";
}
const int bSize=4096;
QCString contents(bSize);
int totalSize=0;
int size;
while ((size=(int)fread(contents.data()+totalSize,1,bSize,f))==bSize)
{
totalSize+=bSize;
contents.resize(totalSize+bSize);
}
totalSize = filterCRLF(contents.data(),totalSize+size)+2;
contents.resize(totalSize);
contents.at(totalSize-2)='\n'; // to help the scanner
contents.at(totalSize-1)='\0';
portable_pclose(f);
Debug::print(Debug::FilterOutput, 0, "Filter output\n");
Debug::print(Debug::FilterOutput,0,"-------------\n%s\n-------------\n",contents.data());
return transcodeCharacterStringToUTF8(contents);
}
#endif
}
if
(
!
fileOpened
)
{
...
...
@@ -7435,7 +7381,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
Config_getString
(
"INPUT_ENCODING"
),
"UTF-8"
);
}
inBuf
.
addChar
(
'\n'
);
/* to prevent problems under Windows ? */
//
inBuf.addChar('\n'); /* to prevent problems under Windows ? */
// and translate CR's
size
=
inBuf
.
curPos
()
-
start
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment