fix bad character checking in wordexp