Changeset 1536 for trunk/src/kmk/expand.c
- Timestamp:
- Apr 21, 2008, 12:46:03 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/expand.c
r1458 r1536 186 186 return o; 187 187 188 #ifdef CONFIG_WITH_VALUE_LENGTH 189 if (!v->recursive) 190 { 191 assert (v->value_length == strlen (v->value)); 192 o = variable_buffer_output (o, v->value, v->value_length); 193 } 194 else 195 { 196 value = recursively_expand (v); 197 o = variable_buffer_output (o, value, strlen (value)); 198 free (value); 199 } 200 #else /* !CONFIG_WITH_VALUE_LENGTH */ 188 201 value = (v->recursive ? recursively_expand (v) : v->value); 189 202 … … 192 205 if (v->recursive) 193 206 free (value); 207 #endif /* !CONFIG_WITH_VALUE_LENGTH */ 194 208 195 209 return o; … … 572 586 if (buf > variable_buffer) 573 587 buf = variable_buffer_output (buf, " ", 1); 588 #ifdef CONFIG_WITH_VALUE_LENGTH 589 assert (v->value_length == strlen (v->value)); 590 #endif 574 591 575 592 /* Either expand it or copy it, depending. */ 576 593 if (! v->recursive) 577 594 #ifdef CONFIG_WITH_VALUE_LENGTH 578 return variable_buffer_output (buf, v->value, 579 v->value_length >= 0 ? v->value_length : strlen (v->value)); 595 return variable_buffer_output (buf, v->value, v->value_length); 580 596 #else 581 597 return variable_buffer_output (buf, v->value, strlen (v->value)); … … 583 599 584 600 #ifdef CONFIG_WITH_VALUE_LENGTH 585 buf = variable_expand_string (buf, v->value, v->value_length >= 0 ? v->value_length : strlen (v->value));601 buf = variable_expand_string (buf, v->value, v->value_length); 586 602 #else 587 603 buf = variable_expand_string (buf, v->value, strlen (v->value));
Note:
See TracChangeset
for help on using the changeset viewer.