Divided Senate approves bill to revive military courts