Which parent gets to claim an 18 year old college student if the divorce decree does not address it?

My son is 18 years old and a full time college student.  My divorce was final in 2006 and it states that I get the tax deductions and primary custody, however it only addresses the deduction while my child is a "minor".  Now that my child is over the age of 18, my ex is demanding that he gets to deduct our son on his taxes and has threatened to take me to court if I don't agree.  How does the IRS determine who gets the deduction at this point since my decree doesn't address this once my son is no longer a minor?  I should note that my ex has never provided a roof over our son's head.  My son has never had a bedroom at his home and this past several years he spent one, maybe two nights there on the couch. On breaks from school my son comes to my house or his grandparents.   My ex and I live in different states and he is threatening to take me to court in his home state where the divorce decree was finalized.  Help!  I will do what is legally correct but it just feels wrong that someone who doesn't even provide a home for a child can claim him as a dependent.  Who legally gets the deduction?