New York enacts gun-control law