After a couple of hours searching the WP core I've lost hope finding this myself (for once).
Could someone guide me perhaps to where WordPress handles the incremental number when having duplicate file names during uploading?
As a side question. When handling questions like this, where and how would you start searching? AFAIK I've searched through every file containing