1207 */
1208 if (name == path_name) {
1209 flush_path_cache();
1210 }
1211 if (name == virtual_root) {
1212 flush_vroot_cache();
1213 }
1214 /* If this sets the VPATH we remember that */
1215 if ((name == vpath_name) &&
1216 (value != NULL) &&
1217 (value->hash.length > 0)) {
1218 vpath_defined = true;
1219 }
1220 /*
1221 * For environment variables we also set the
1222 * environment value each time.
1223 */
1224 if (macro->body.macro.exported) {
1225 static char *env;
1226
1227 #ifdef DISTRIBUTED
1228 if (!reading_environment && (value != NULL)) {
1229 #else
1230 if (!reading_environment && (value != NULL) && value->dollar) {
1231 #endif
1232 Envvar p;
1233
1234 for (p = envvar; p != NULL; p = p->next) {
1235 if (p->name == name) {
1236 p->value = value;
1237 p->already_put = false;
1238 goto found_it;
1239 }
1240 }
1241 p = ALLOC(Envvar);
1242 p->name = name;
1243 p->value = value;
1244 p->next = envvar;
1245 p->env_string = NULL;
1246 p->already_put = false;
1247 envvar = p;
1248 found_it:;
1249 #ifdef DISTRIBUTED
1250 }
1251 if (reading_environment || (value == NULL) || !value->dollar) {
1252 #else
1253 } else {
1254 #endif
1255 length = 2 + strlen(name->string_mb);
1256 if (value != NULL) {
1257 length += strlen(value->string_mb);
1258 }
1259 Property env_prop = maybe_append_prop(name, env_mem_prop);
1260 /*
1261 * We use a permanent buffer to reset SUNPRO_DEPENDENCIES value.
1262 */
1263 if (!strncmp(name->string_mb, NOCATGETS("SUNPRO_DEPENDENCIES"), 19)) {
1264 if (length >= sunpro_dependencies_buf_size) {
1265 sunpro_dependencies_buf_size=length*2;
1266 if (sunpro_dependencies_buf_size < 4096)
1267 sunpro_dependencies_buf_size = 4096; // Default minimum size
1268 if (sunpro_dependencies_buf)
1269 sunpro_dependencies_oldbuf = sunpro_dependencies_buf;
1270 sunpro_dependencies_buf=getmem(sunpro_dependencies_buf_size);
1271 }
1272 env = sunpro_dependencies_buf;
1273 } else {
1274 env = getmem(length);
|
1207 */
1208 if (name == path_name) {
1209 flush_path_cache();
1210 }
1211 if (name == virtual_root) {
1212 flush_vroot_cache();
1213 }
1214 /* If this sets the VPATH we remember that */
1215 if ((name == vpath_name) &&
1216 (value != NULL) &&
1217 (value->hash.length > 0)) {
1218 vpath_defined = true;
1219 }
1220 /*
1221 * For environment variables we also set the
1222 * environment value each time.
1223 */
1224 if (macro->body.macro.exported) {
1225 static char *env;
1226
1227 if (!reading_environment && (value != NULL) && value->dollar) {
1228 Envvar p;
1229
1230 for (p = envvar; p != NULL; p = p->next) {
1231 if (p->name == name) {
1232 p->value = value;
1233 p->already_put = false;
1234 goto found_it;
1235 }
1236 }
1237 p = ALLOC(Envvar);
1238 p->name = name;
1239 p->value = value;
1240 p->next = envvar;
1241 p->env_string = NULL;
1242 p->already_put = false;
1243 envvar = p;
1244 found_it:;
1245 } else {
1246 length = 2 + strlen(name->string_mb);
1247 if (value != NULL) {
1248 length += strlen(value->string_mb);
1249 }
1250 Property env_prop = maybe_append_prop(name, env_mem_prop);
1251 /*
1252 * We use a permanent buffer to reset SUNPRO_DEPENDENCIES value.
1253 */
1254 if (!strncmp(name->string_mb, NOCATGETS("SUNPRO_DEPENDENCIES"), 19)) {
1255 if (length >= sunpro_dependencies_buf_size) {
1256 sunpro_dependencies_buf_size=length*2;
1257 if (sunpro_dependencies_buf_size < 4096)
1258 sunpro_dependencies_buf_size = 4096; // Default minimum size
1259 if (sunpro_dependencies_buf)
1260 sunpro_dependencies_oldbuf = sunpro_dependencies_buf;
1261 sunpro_dependencies_buf=getmem(sunpro_dependencies_buf_size);
1262 }
1263 env = sunpro_dependencies_buf;
1264 } else {
1265 env = getmem(length);
|