Changeset 3445 for trunk/src


Ignore:
Timestamp:
Sep 10, 2020, 10:47:45 PM (5 years ago)
Author:
bird
Message:

kash: fixed a couple of alloctions when setting up subshells. Must pass redir to openhere_child.

Location:
trunk/src/kash
Files:
2 edited

Legend:

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

    r3438 r3445  
    132132    psh->shellparam.nparam = left = inherit->shellparam.nparam;
    133133    assert(left >= 0);
    134     psh->shellparam.p = (char **)ckmalloc(psh, left + 1);
     134    psh->shellparam.p = (char **)ckmalloc(psh, (left + 1) * sizeof(psh->shellparam.p[0]));
    135135    psh->shellparam.p[left] = NULL;
    136136    while (left-- > 0) {
  • trunk/src/kash/redir.c

    r3442 r3445  
    104104        do
    105105        {
    106             struct redirtab *dst = ckmalloc(psh, sizeof(dst));
     106            struct redirtab *dst = ckmalloc(psh, sizeof(*dst));
    107107            memcpy(dst->renamed, src->renamed, sizeof(dst->renamed));
    108108            *dstp = dst;
     
    314314                args.pip[1] = pip[1];
    315315                args.len = len;
    316                 forkshell2(psh, (struct job *)NULL, (union node *)NULL,
     316                forkshell2(psh, (struct job *)NULL, redir,
    317317                           FORK_NOJOB | FORK_JUST_IO,
    318318                           openhere_child, redir, &args, sizeof(args), NULL);
Note: See TracChangeset for help on using the changeset viewer.