Author Topic: A possible bug in 'cbproject.cpp'  (Read 3662 times)

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
A possible bug in 'cbproject.cpp'
« on: March 06, 2015, 01:05:18 am »
At line 780 of file 'src/sdk/cbproject.cpp':
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:
pf = new ProjectFile(this);
and 'existing' is a search result:
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:
if (existing != nullptr)
This actually works but the former doesn't. Am I wrong about this?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: A possible bug in 'cbproject.cpp'
« Reply #1 on: November 09, 2019, 01:06:01 pm »
Fixed in svn... Lets see how many projects I've broken.  ::)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]