Fix bug 1039760: Add patch support for env vars