Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: scarphin on March 06, 2015, 01:05:18 am

Title: A possible bug in 'cbproject.cpp'
Post by: scarphin on March 06, 2015, 01:05:18 am
At line 780 of file 'src/sdk/cbproject.cpp':
Code
if (existing == pf)
checks if the file is already added to the project. I don't understand this.

'pf' is allocated at line 650 in the same function:
Code
pf = new ProjectFile(this);
and 'existing' is a search result:
Code
ProjectFile* existing = GetFileByFilename(pf->relativeFilename, true, true);
Why would 'pf' and 'existing' be equal even if they have the same file name? Shouldn't the check expression be like that:
Code
if (existing != nullptr)
This actually works but the former doesn't. Am I wrong about this?
Title: Re: A possible bug in 'cbproject.cpp'
Post by: oBFusCATed on November 09, 2019, 01:06:01 pm
Fixed in svn... Lets see how many projects I've broken.  ::)