Edit

kc3-lang/linenoise

Branch :

  • Show log

    Commit

  • Author : Nick Gasson
    Date : 2014-01-06 11:04:02
    Hash : e153bd83
    Message : Fix escape sequence processing when only one byte available The read call in the escape sequence processing does not handle the case where only the first byte is available. This can happen for example on a slow serial terminal. Comment by @antirez: I reworked the code for brevity, for historical reasons here is the proposed patch. I believe my fix should be functionally equivalent. Original fix: case 27: /* escape sequence */ /* Read the next two bytes representing the escape sequence. */ - if (read(fd,seq,2) == -1) break; + { + ssize_t b = read(fd, seq, 2); + + if (b < 0) break; + + if (b == 1) { + b = read(fd,&seq[1], 1); + if (b != 1) { + break; + } + } + } See PR #47.

  • Properties
  • Git HTTP https://git.kmx.io/kc3-lang/linenoise.git
    Git SSH git@git.kmx.io:kc3-lang/linenoise.git
    Public ? true
    Name
    Description

    A minimal, zero-config, BSD licensed, readline replacement used in Redis, MongoDB, and Android.

    Users
    -
    +
    thodg git_deploy kc3_lang_org thodg_l thodg_m thodg_w www_kmx_io
    Tags