Changeset 575 in kBuild
- Timestamp:
- Nov 23, 2006 8:57:34 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/gmake/kbuild.c ¶
r558 r575 547 547 { 548 548 int i, j; 549 size_t cchTmp ;549 size_t cchTmp, cch; 550 550 char *pszTmp; 551 551 unsigned cchCur; … … 559 559 560 560 /* determin required tmp variable name space. */ 561 cchTmp = ( pTarget->value_length + 1 562 + pSource->value_length + 6 563 + pBldTrg->value_length + 1 564 + pBldTrgArch->value_length + 4) * 4; 561 cchTmp = sizeof("$(__SDKS) $(__SDKS.) $(__SDKS.) $(__SDKS.) $(__SDKS..)") 562 + (pTarget->value_length + pSource->value_length) * 5 563 + pBldType->value_length 564 + pBldTrg->value_length 565 + pBldTrgArch->value_length 566 + pBldTrg->value_length + pBldTrgArch->value_length; 565 567 pszTmp = alloca(cchTmp); 566 567 568 568 569 /* the global sdks. */ 569 570 pSdks->iGlobal = i; 570 571 pSdks->cGlobal = 0; 571 sprintf(pszTmp, "$(SDKS) $(SDKS.%s) $(SDKS.%s) $(SDKS.%s.%s)", 572 pBldType->value, pBldTrg->value, pBldTrg->value, pBldTrgArch->value); 572 sprintf(pszTmp, "$(SDKS) $(SDKS.%s) $(SDKS.%s) $(SDKS.%s) $(SDKS.%s.%s)", 573 pBldType->value, 574 pBldTrg->value, 575 pBldTrgArch->value, 576 pBldTrg->value, pBldTrgArch->value); 573 577 pszIterator = pSdks->apsz[0] = allocated_variable_expand(pszTmp); 574 578 while ((pszCur = find_next_token(&pszIterator, &cchCur)) != 0) … … 579 583 pSdks->iTarget = i; 580 584 pSdks->cTarget = 0; 581 sprintf(pszTmp, "$(%s_SDKS) $(%s_SDKS.%s) $(%s_SDKS.%s) $(%s_SDKS.%s .%s)",585 sprintf(pszTmp, "$(%s_SDKS) $(%s_SDKS.%s) $(%s_SDKS.%s) $(%s_SDKS.%s) $(%s_SDKS.%s.%s)", 582 586 pTarget->value, 583 587 pTarget->value, pBldType->value, 584 588 pTarget->value, pBldTrg->value, 589 pTarget->value, pBldTrgArch->value, 585 590 pTarget->value, pBldTrg->value, pBldTrgArch->value); 586 591 pszIterator = pSdks->apsz[1] = allocated_variable_expand(pszTmp); … … 592 597 pSdks->iSource = i; 593 598 pSdks->cSource = 0; 594 sprintf(pszTmp, "$(%s_SDKS) $(%s_SDKS.%s) $(%s_SDKS.%s) $(%s_SDKS.%s .%s)",599 sprintf(pszTmp, "$(%s_SDKS) $(%s_SDKS.%s) $(%s_SDKS.%s) $(%s_SDKS.%s) $(%s_SDKS.%s.%s)", 595 600 pSource->value, 596 601 pSource->value, pBldType->value, 597 602 pSource->value, pBldTrg->value, 603 pSource->value, pBldTrgArch->value, 598 604 pSource->value, pBldTrg->value, pBldTrgArch->value); 599 605 pszIterator = pSdks->apsz[2] = allocated_variable_expand(pszTmp); … … 605 611 pSdks->iTargetSource = i; 606 612 pSdks->cTargetSource = 0; 607 sprintf(pszTmp, "$(%s_%s_SDKS) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s.%s)", 608 pTarget->value, pSource->value, 609 pTarget->value, pSource->value, pBldType->value, 610 pTarget->value, pSource->value, pBldTrg->value, 611 pTarget->value, pSource->value, pBldTrg->value, pBldTrgArch->value); 613 cch = sprintf(pszTmp, "$(%s_%s_SDKS) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s) $(%s_%s_SDKS.%s.%s)", 614 pTarget->value, pSource->value, 615 pTarget->value, pSource->value, pBldType->value, 616 pTarget->value, pSource->value, pBldTrg->value, 617 pTarget->value, pSource->value, pBldTrgArch->value, 618 pTarget->value, pSource->value, pBldTrg->value, pBldTrgArch->value); 619 assert(cch < cchTmp); (void)cch; 612 620 pszIterator = pSdks->apsz[3] = allocated_variable_expand(pszTmp); 613 621 while ((pszCur = find_next_token(&pszIterator, &cchCur)) != 0) … … 626 634 for (i = j = 0; j < sizeof(pSdks->apsz) / sizeof(pSdks->apsz[0]); j++) 627 635 { 636 int k = i; 628 637 pszIterator = pSdks->apsz[j]; 629 638 while ((pszCur = find_next_token(&pszIterator, &cchCur)) != 0) … … 631 640 pSdks->pa[i].value = pszCur; 632 641 pSdks->pa[i].value_length = cchCur; 633 pszCur[cchCur] = '\0';642 i++; 634 643 } 635 644 } 645 assert(i == pSdks->c); 646 647 /* terminate them (find_next_token won't work if we terminate them in the previous loop). */ 648 while (i-- > 0) 649 pSdks->pa[i].value[pSdks->pa[i].value_length] = '\0'; 636 650 } 637 651
Note:
See TracChangeset
for help on using the changeset viewer.