Ignore:
Timestamp:
Oct 6, 2007, 11:19:19 PM (18 years ago)
Author:
bird
Message:

moving globals into shinstance...

File:
1 edited

Legend:

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

    r809 r1198  
    125125        status = 0;
    126126        startword = 2;
    127         STARTSTACKSTR(p);
     127        STARTSTACKSTR(psh, p);
    128128        for (;;) {
    129129                if (read(0, &c, 1) != 1) {
     
    139139                        }
    140140                        if (c != '\n')
    141                                 STPUTC(c, p);
     141                                STPUTC(psh, c, p);
    142142                        continue;
    143143                }
     
    153153                                /* Ignore leading IFS whitespace */
    154154                                if (saveall)
    155                                         STPUTC(c, p);
     155                                        STPUTC(psh, c, p);
    156156                                continue;
    157157                        }
     
    160160                                startword = 2;
    161161                                if (saveall)
    162                                         STPUTC(c, p);
     162                                        STPUTC(psh, c, p);
    163163                                continue;
    164164                        }
     
    171171                                /* Not just a spare terminator */
    172172                                saveall++;
    173                         STPUTC(c, p);
     173                        STPUTC(psh, c, p);
    174174                        continue;
    175175                }
     
    181181                        /* Last variable needs all IFS chars */
    182182                        saveall++;
    183                         STPUTC(c, p);
     183                        STPUTC(psh, c, p);
    184184                        continue;
    185185                }
    186186
    187                 STACKSTRNUL(p);
    188                 setvar(*ap, stackblock(), 0);
     187                STACKSTRNUL(psh, p);
     188                setvar(*ap, stackblock(psh), 0);
    189189                ap++;
    190                 STARTSTACKSTR(p);
    191         }
    192         STACKSTRNUL(p);
     190                STARTSTACKSTR(psh, p);
     191        }
     192        STACKSTRNUL(psh, p);
    193193
    194194        /* Remove trailing IFS chars */
    195         for (; stackblock() <= --p; *p = 0) {
     195        for (; stackblock(psh) <= --p; *p = 0) {
    196196                if (!strchr(ifs, *p))
    197197                        break;
     
    203203                        break;
    204204        }
    205         setvar(*ap, stackblock(), 0);
     205        setvar(*ap, stackblock(psh), 0);
    206206
    207207        /* Set any remaining args to "" */
Note: See TracChangeset for help on using the changeset viewer.