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);
|
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)) {
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 } if (reading_environment || (value == NULL) || !value->dollar) {
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);
|