Changeset 3363 for trunk/src


Ignore:
Timestamp:
Jun 8, 2020, 9:29:15 PM (5 years ago)
Author:
bird
Message:

kSubmit: Quoting fixes for the history dump.

File:
1 edited

Legend:

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

    r3355 r3363  
    12261226                const char * const psz = va_arg(va, const char *);
    12271227                size_t const       cch = strlen(psz);
    1228                 if (memchr(psz, '\'', cch))
     1228                if (cch == 0 || memchr(psz, '\'', cch))
    12291229                {
    12301230                    kSubmitDumpHistoryWrite(pBuf, TUPLE("\"")); /** @todo what if there are '"' in the string? */
     
    12331233                }
    12341234                else if (   !memchr(psz, ' ', cch)
     1235                         && !memchr(psz, '\\', cch)
    12351236                         && !memchr(psz, '\t', cch)
    12361237                         && !memchr(psz, '\n', cch)
Note: See TracChangeset for help on using the changeset viewer.