Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

A possible bug in 'cbproject.cpp'

(1/1)

scarphin:
At line 780 of file 'src/sdk/cbproject.cpp':

--- Code: ---if (existing == pf)
--- End code ---
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);
--- End code ---
and 'existing' is a search result:

--- Code: ---ProjectFile* existing = GetFileByFilename(pf->relativeFilename, true, true);
--- End code ---
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)
--- End code ---
This actually works but the former doesn't. Am I wrong about this?

oBFusCATed:
Fixed in svn... Lets see how many projects I've broken.  ::)

Navigation

[0] Message Index

Go to full version