Fixing logic error in matybe_link_file()