Changeset 530 for trunk/src/gmake/variable.c
- Timestamp:
- Sep 17, 2006, 10:38:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/variable.c
r527 r530 351 351 if ((int) origin >= (int) v->origin) 352 352 { 353 if (v->value != 0) 354 free (v->value); 353 #ifdef CONFIG_WITH_VALUE_LENGTH 354 v->value_length = strlen (value); 355 v->value = xrealloc (v->value, v->value_length + 1); 356 bcopy (value, v->value, v->value_length + 1); 357 #else 358 if (v->value != 0) 359 free (v->value); 355 360 v->value = xstrdup (value); 361 #endif 356 362 if (flocp != 0) 357 363 v->fileinfo = *flocp; … … 374 380 #endif 375 381 hash_insert_at (&set->table, v, var_slot); 382 #ifdef CONFIG_WITH_VALUE_LENGTH 383 v->value_length = strlen (value); 384 v->value = xmalloc (v->value_length + 1); 385 bcopy (value, v->value, v->value_length + 1); 386 #else 376 387 v->value = xstrdup (value); 388 #endif 377 389 if (flocp != 0) 378 390 v->fileinfo = *flocp; … … 1031 1043 v->origin = o_file; 1032 1044 v->value = xstrdup (default_shell); 1045 #ifdef CONFIG_WITH_VALUE_LENGTH 1046 v->value_length = -1; 1047 #endif 1033 1048 } 1034 1049 #endif … … 1305 1320 val = alloc_value = allocated_variable_expand (val); 1306 1321 1307 oldlen = strlen (v->value); 1322 #ifdef CONFIG_WITH_VALUE_LENGTH 1323 oldlen = v->value_length; 1324 assert(oldlen == strlen (v->value)); 1325 #endif 1308 1326 vallen = strlen (val); 1309 1327 p = (char *) alloca (oldlen + 1 + vallen + 1); … … 1538 1556 p = next_token (p); 1539 1557 v->value = p; 1558 #ifdef CONFIG_WITH_VALUE_LENGTH 1559 v->value_length = -1; 1560 #endif 1540 1561 1541 1562 /* Expand the name, so "$(foo)bar = baz" works. */
Note:
See TracChangeset
for help on using the changeset viewer.