Deduplicate setenv.

Setenv contained a code path that was redundant as it could be handled
in general case.