Fix typos and comments

Co-Authored-By: Michael Schurter <michael.schurter@gmail.com>
This commit is contained in:
Mahmood Ali
2019-05-16 17:06:03 -04:00
committed by GitHub
parent eedd8e9e66
commit 0b4bebd3aa
2 changed files with 3 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ func TestAllocExecCommand_Fails(t *testing.T) {
"A command is required",
},
{
"log escaped char",
"long escaped char",
[]string{"-address=" + url, "-e", "long_escape", "26470238-5CF2-438F-8772-DC67CFB0705C", "/bin/bash"},
"a single character",
},

View File

@@ -20,7 +20,7 @@ type Handler func(c byte) bool
// If handler returns true, `~.` will be skipped; otherwise, it's propagated.
// * `~` and it's the last character in stream, it's propagated
//
// Appearances of `~` when not followed by a new line is propagated unmodified.
// Appearances of `~` when not preceded by a new line are propagated unmodified.
func NewReader(r io.Reader, c byte, h Handler) io.Reader {
return &reader{
impl: r,
@@ -88,7 +88,7 @@ START:
// escape character hasn't been emitted yet
if buf[0] == r.escapeChar {
// earlier ~ was sallowed already, so leave this as is
// earlier ~ was swallowed already, so leave this as is
} else if handled := r.handler(buf[0]); handled {
// need to drop a single letter
copy(buf, buf[1:n])