Changeset 1446 in kBuild
- Timestamp:
- Mar 30, 2008 7:56:34 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/function.c
r1445 r1446 1548 1548 if (v) 1549 1549 { 1550 char *tmp;1551 1550 char *buf; 1552 1551 unsigned int len; 1553 1552 int var_ctx; 1553 size_t off; 1554 1555 /* Make a copy of the value to the variable buffer since 1556 eval_buffer will make changes to its input. */ 1557 1558 off = o - variable_buffer; 1559 o = variable_buffer_output (o, v->value, v->value_length + 1); 1560 o = variable_buffer + off; 1554 1561 1555 1562 /* Eval the value. Pop the current variable buffer setting so that the … … 1561 1568 push_new_variable_scope (); 1562 1569 1563 tmp = xmalloc (v->value_length + 1); 1564 memcpy (tmp, v->value, v->value_length + 1); 1565 eval_buffer (tmp); 1566 free (tmp); 1570 eval_buffer (o); 1567 1571 1568 1572 if (var_ctx) … … 4188 4192 #ifdef CONFIG_WITH_EVALPLUS 4189 4193 } 4190 else if (!strcmp (funcname, "evalcall")) 4191 { 4192 /* Evaluate the variable value directly without expanding it first. */ 4193 char *tmp; 4194 4195 install_variable_buffer (&buf, &len); 4196 4197 tmp = xmalloc (v->value_length + 1); 4198 memcpy (tmp, v->value, v->value_length + 1); 4199 eval_buffer (tmp); 4200 free (tmp); 4201 4202 restore_variable_buffer (buf, len); 4203 } 4204 else /* evalcall2: */ 4205 { 4206 /* Expand the body first and then evaluate the output. */ 4207 4208 v->exp_count = EXP_COUNT_MAX; 4209 o = variable_expand_string (o, body, flen+3); 4210 v->exp_count = 0; 4194 else 4195 { 4196 if (!strcmp (funcname, "evalcall")) 4197 { 4198 /* Evaluate the variable value without expanding it. We 4199 need a copy since eval_buffer is destructive. */ 4200 4201 size_t off = o - variable_buffer; 4202 o = variable_buffer_output (o, v->value, v->value_length + 1); 4203 o = variable_buffer + off; 4204 } 4205 else 4206 { 4207 /* Expand the body first and then evaluate the output. */ 4208 4209 v->exp_count = EXP_COUNT_MAX; 4210 o = variable_expand_string (o, body, flen+3); 4211 v->exp_count = 0; 4212 } 4211 4213 4212 4214 install_variable_buffer (&buf, &len);
Note:
See TracChangeset
for help on using the changeset viewer.