VirtualBox

Changeset 2628 in kBuild for trunk/src/kash/parser.c


Ignore:
Timestamp:
Sep 6, 2012 3:16:12 PM (12 years ago)
Author:
bird
Message:

kash/parser.c: Fixed incorrect handling of \r\n -> \n conversion when there is a lone \r at the end of the input buffer.

File:
1 edited

Legend:

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

    r2312 r2628  
    767767            TRACE((psh, "token %s %s\n", tokname[t], t == TWORD ? psh->wordtext : ""));
    768768        else
    769             TRACE((psh, "reread token %s %s\n", tokname[t], t == TWORD ? psh->wordtext : ""));
     769            TRACE((psh, "reread token %s \"%s\"\n", tokname[t], t == TWORD ? psh->wordtext : ""));
    770770#endif
    771771        return (t);
     
    809809        for (;;) {      /* until token or start of word found */
    810810                c = pgetc_macro(psh);
     811trace(psh, "xxreadtoken: c=%#x", c);
    811812                if (c == ' ' || c == '\t')
    812813                        continue;               /* quick check for white space first */
     
    854855                case ')':
    855856                        RETURN(TRP);
    856                 default:
     857                default:
    857858                        goto breakloop;
    858859                }
     
    16151616synerror(shinstance *psh, const char *msg)
    16161617{
    1617         if (psh->commandname)
     1618        if (psh->commandname) {
     1619                trace(psh, "synerror: %s: %d: Syntax error: %s", psh->commandname, psh->startlinno, msg);
    16181620                outfmt(&psh->errout, "%s: %d: ", psh->commandname, psh->startlinno);
     1621        } else {
     1622                trace(psh, "synerror: Syntax error: %s\n", msg);
     1623        }
    16191624        outfmt(&psh->errout, "Syntax error: %s\n", msg);
    16201625        error(psh, (char *)NULL);
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