Ignore:
Timestamp:
Sep 17, 2020, 11:52:16 PM (5 years ago)
Author:
bird
Message:

kash: Use kHlpAssert instead of assert.h (debugger stops on the assertion rather than at exit process code).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/options.c

    r3445 r3477  
    4141#endif
    4242
    43 #include <assert.h>
    4443#include <stdlib.h>
    4544
     
    109108            i++;
    110109        }
    111         assert(psh->arg0 != NULL);
     110        kHlpAssert(psh->arg0 != NULL);
    112111    }
    113112
     
    131130    psh->shellparam.reset  = inherit->shellparam.reset;
    132131    psh->shellparam.nparam = left = inherit->shellparam.nparam;
    133     assert(left >= 0);
     132    kHlpAssert(left >= 0);
    134133    psh->shellparam.p = (char **)ckmalloc(psh, (left + 1) * sizeof(psh->shellparam.p[0]));
    135134    psh->shellparam.p[left] = NULL;
     
    142141    if (inherit->shellparam.optnext) {
    143142        size_t idx = (size_t)(inherit->shellparam.optnext - inherit->shellparam.p);
    144         assert(idx <= inherit->shellparam.nparam);
     143        kHlpAssert(idx <= inherit->shellparam.nparam);
    145144        if (idx <= inherit->shellparam.nparam)
    146145            psh->shellparam.optnext = &psh->shellparam.p[idx];
     
    169168            off--;
    170169        }
    171         assert(psh->shellparam.optptr != NULL);
     170        kHlpAssert(psh->shellparam.optptr != NULL);
    172171    }
    173172
     
    225224        psh->shellparam.p = psh->argptr;
    226225        psh->shellparam.reset = 1;
    227         /* assert(shellparam.malloc == 0 && shellparam.nparam == 0); */
     226        /* kHlpAssert(shellparam.malloc == 0 && shellparam.nparam == 0); */
    228227        while (*psh->argptr) {
    229228                psh->shellparam.nparam++;
Note: See TracChangeset for help on using the changeset viewer.