Would this be a deal breaker for you?

We visited a house today that we'd been interested in for a while. There was a lingering smell of smoke upstairs where the bedrooms were carpeted. The rest of the house (hardwood and tile) did not smell like smoke. I'm not opposed to replacing the carpet if we bought the house, but I would hate to buy it, replace the carpet, and still have the smoke smell. Has anyone ever dealt with this? Or would it be a deal breaker straightaway for you?