Ignore:
Timestamp:
Apr 21, 2020, 1:55:38 AM (5 years ago)
Author:
bird
Message:

kmk/kmkbuiltin.c: Handle escaped end-of-line better in kmk_builtin_command.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin.c

    r3293 r3333  
    135135                            {
    136136                                ch = *pszCmd++;
     137                                if (ch == '\n')                    /* escaped end-of-line */
     138                                    break;
     139                                if (ch == '\r' && *pszCmd == '\n') /* escaped end-of-line */
     140                                {
     141                                    pszCmd++;
     142                                    break;
     143                                }
    137144                                if (ch)
    138145                                    *pszDst++ = ch;
     
    221228         */
    222229        if (ch != 0)
    223             while ((ch = *pszCmd) && isspace(ch))
     230            while (   (ch = *pszCmd)
     231                   && (   isspace(ch)
     232                       || (ch == '\\' && (pszCmd[1] == '\n' || (pszCmd[1] == '\r' && pszCmd[2] == '\n')))))
    224233                pszCmd++;
    225234        if (ch == 0)
Note: See TracChangeset for help on using the changeset viewer.