Potential bug. new_filename is defined as const, but returned without the const qualifier.