extendloaderenvironment.cxx (2722cedd) extendloaderenvironment.cxx (910823ae)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 131 unchanged lines hidden (view full) ---

140 if (padEnd == NULL) {
141 fail();
142 }
143 exclude1 = contains(env, pad, padEnd);
144 } else {
145 exclude1 = true;
146 }
147 WCHAR * pad2 = exclude1 ? pad : padEnd + 1;
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 131 unchanged lines hidden (view full) ---

140 if (padEnd == NULL) {
141 fail();
142 }
143 exclude1 = contains(env, pad, padEnd);
144 } else {
145 exclude1 = true;
146 }
147 WCHAR * pad2 = exclude1 ? pad : padEnd + 1;
148 pathEnd = tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link"));
148// pathEnd = tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link"));
149 pathEnd = tools::buildPath(path, path, pathEnd, MY_STRING(L""));
149 if (pathEnd == NULL) {
150 fail();
151 }
150 if (pathEnd == NULL) {
151 fail();
152 }
152 pathEnd = tools::resolveLink(path);
153 if (pathEnd == NULL) {
154 fail();
155 }
156 padEnd = tools::buildPath(pad2, path, pathEnd, MY_STRING(L"\\bin"));
157 if (padEnd == NULL) {
158 fail();
159 }
153 // pathEnd = tools::resolveLink(path);
154 // if (pathEnd == NULL) {
155 // fail();
156 // }
157 // padEnd = tools::buildPath(pad2, path, pathEnd, MY_STRING(L"\\bin"));
158 // if (padEnd == NULL) {
159 // fail();
160 // }
160 bool exclude2 = contains(env, pad2, padEnd);
161 if (!(exclude1 && exclude2)) {
162 if (!(exclude1 || exclude2)) {
163 pad2[-1] = L';';
164 }
165 WCHAR * p = exclude2 ? pad2 - 1 : padEnd;
166 if (n != 0) {
167 *p++ = L';';
168 }
169 for (DWORD i = 0; i <= n; ++i) {
170 *p++ = env[i];
171 }
172 if (!SetEnvironmentVariableW(L"PATH", pad)) {
173 fail();
174 }
175 }
176}
177
178}
161 bool exclude2 = contains(env, pad2, padEnd);
162 if (!(exclude1 && exclude2)) {
163 if (!(exclude1 || exclude2)) {
164 pad2[-1] = L';';
165 }
166 WCHAR * p = exclude2 ? pad2 - 1 : padEnd;
167 if (n != 0) {
168 *p++ = L';';
169 }
170 for (DWORD i = 0; i <= n; ++i) {
171 *p++ = env[i];
172 }
173 if (!SetEnvironmentVariableW(L"PATH", pad)) {
174 fail();
175 }
176 }
177}
178
179}