Ignore:
Timestamp:
Apr 17, 2020, 12:23:49 AM (5 years ago)
Author:
bird
Message:

kmk/kbuild: kbuild_apply_defpath must walk quoted file tokens rather than simple space separated tokens. Added find_next_file_token to do the parsing. Updated find_next_token_eos with correct variable expansion skipping.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kbuild.c

    r3278 r3322  
    382382kbuild_apply_defpath(struct variable *pDefPath, char **ppsz, unsigned int *pcch, unsigned int *pcchAlloc, int fCanFree)
    383383{
    384     const char *pszIterator;
    385     const char *pszInCur;
    386384    unsigned int cchInCur;
    387385    unsigned int cchMaxRelative = 0;
    388     unsigned int cRelativePaths;
     386    const char *pszInCur;
    389387
    390388    /*
    391389     * The first pass, count the relative paths.
    392390     */
    393     cRelativePaths = 0;
    394     pszIterator = *ppsz;
    395     while ((pszInCur = find_next_token(&pszIterator, &cchInCur)) != NULL)
     391    const char *pszIterator = *ppsz;
     392    const char * const pszEos = pszIterator + *pcch;
     393    unsigned int cRelativePaths = 0;
     394    assert(*pszEos == '\0');
     395    while ((pszInCur = find_next_file_token(&pszIterator, pszEos, &cchInCur)) != NULL)
    396396    {
    397397        /* is relative? */
     
    438438        cRelativePaths = 0;
    439439        pszIterator = *ppsz;
    440         while ((pszInCur = find_next_token(&pszIterator, &cchInCur)))
     440        while ((pszInCur = find_next_file_token(&pszIterator, pszEos, &cchInCur)))
    441441        {
    442442            /* is relative? */
Note: See TracChangeset for help on using the changeset viewer.