There is nothing to fix, as this is intended behaviour. I don't know why it's intended, but it is.
The way I had originally implemented that function would just rename the file, overwriting a possibly existing file. This of course assumes a basic amount of diligence from the user's part, but I did not deem that as a problem.
Code::Blocks is not thought to replace Windows Explorer, it only contains that function to make your life easier when you need to rename files in your project (so renaming on the file system and in the project is one operation).
Later, it was found that if you provide users with a way to rename files and allow them to overwrite an existing file, they will do it 20 times per day, and they will never learn it. Neither will they see that they're doing something wrong. Thus, functionality was added to check for existence before overwriting a file (therefore, setting the overwrite flag is
not an option).
Now, the problem is,
Main.h and
main.h are really the same file under Windows. I don't know why, it does not make sense to me, but this is intended behaviour ever since the days of DOS.
If you ask for
Main.h, and
main.h exists, you get
main.h.
The only possibility to work around this (which is probably what Explorer and Visual Studio do, too) is to add an extra case-insensitive comparison, and silently overwrite files if that comparison returns equality.
But... no thank you! I think we'll rather live with the fact that
Main.h can't be renamed into
main.h under Windows than add such nasty hacks to work around deliberately wrong behaviour