Changeset 1847 for trunk/src/kmk/file.c
- Timestamp:
- Oct 12, 2008, 6:25:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/file.c
r1833 r1847 507 507 struct dep *new, *d1; 508 508 char *p; 509 #ifdef CONFIG_WITH_VALUE_LENGTH 510 unsigned int len; 511 #endif 509 512 510 513 if (! d->name) … … 518 521 p = variable_expand (""); 519 522 buffer_offset = p - variable_buffer; 523 #ifndef CONFIG_WITH_VALUE_LENGTH 520 524 variable_buffer_output (p, d->name, strlen (d->name) + 1); 525 #else 526 len = strcache_get_len (d->name); 527 variable_buffer_output (p, d->name, len + 1); 528 #endif 521 529 p = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. (observed it) */ 522 530 } … … 554 562 set_file_variables (f); 555 563 564 #ifndef CONFIG_WITH_VALUE_LENGTH 556 565 p = variable_expand_for_file (d->name, f); 566 #else 567 len = strcache_get_len (d->name); 568 p = variable_expand_for_file_2 (NULL, d->name, len, f, &len); 569 #endif 557 570 558 571 if (d->stem != 0) … … 561 574 562 575 /* Parse the prerequisites. */ 576 #ifndef CONFIG_WITH_VALUE_LENGTH 563 577 new = parse_prereqs (p); 578 #else 579 /** @todo make use of len here! */ 580 new = parse_prereqs (p); 581 #endif 564 582 565 583 /* If this dep list was from a static pattern rule, expand the %s. We … … 576 594 { 577 595 char *percent; 596 #ifndef KMK 578 597 int nl = strlen (dp->name) + 1; 579 598 char *nm = alloca (nl); 580 599 memcpy (nm, dp->name, nl); 581 600 percent = find_percent (nm); 601 #else /* KMK - don't make a stack copy unless it's actually required! */ 602 unsigned int nl = strcache_get_len (dp->name); 603 char *nm; 604 percent = memchr (nm, '%', nl); 605 if (percent) 606 { 607 nm = alloca (nl + 1); 608 memcpy (nm, dp->name, nl + 1); 609 percent = find_percent (nm); 610 } 611 #endif /* KMK */ 582 612 if (percent) 583 613 {
Note:
See TracChangeset
for help on using the changeset viewer.