VirtualBox

Changeset 2384 in kBuild for trunk/src/kash/eval.c


Ignore:
Timestamp:
Jan 16, 2010 1:00:46 AM (15 years ago)
Author:
bird
Message:

ash: don't bitch about negative return values. (makes vcslite work)

File:
1 edited

Legend:

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

    r2290 r2384  
    11681168returncmd(shinstance *psh, int argc, char **argv)
    11691169{
     1170#if 0
    11701171        int ret = argc > 1 ? number(psh, argv[1]) : psh->exitstatus;
     1172#else
     1173        int ret;
     1174        if (argc > 1)  {
     1175                /* make return -1 and VSC lite work ... */
     1176                if (argv[1][0] != '-' || !is_number(&argv[1][1]))
     1177                        ret = number(psh, argv[1]);
     1178                else
     1179                        ret = -number(psh, &argv[1][1]) & 255; /* take the bash approach */
     1180        } else {
     1181                ret = psh->exitstatus;
     1182        }
     1183#endif
    11711184
    11721185        if (psh->funcnest) {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette