From 8e338856548f7a3040f66d0e7f626c81e1a16fcc Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Fri, 26 Jun 2020 00:01:37 +0800 Subject: [PATCH] Fix failing test and the false negative CI Signed-off-by: Shengjing Zhu --- Makefile | 1 + mountinfo/mountinfo_linux.go | 2 +- mountinfo/mountinfo_linux_test.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3701d351..d37c8cef 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +.SHELLFLAGS = -ec PACKAGES ?= mountinfo mount BINDIR ?= _build/bin diff --git a/mountinfo/mountinfo_linux.go b/mountinfo/mountinfo_linux.go index 20630248..2fd2206d 100644 --- a/mountinfo/mountinfo_linux.go +++ b/mountinfo/mountinfo_linux.go @@ -194,7 +194,7 @@ func unescape(path string) (string, error) { v := c - '0' for j := 2; j < 4; j++ { // one digit already; two more x := s[j] - '0' - if x < 0 || x > 7 { + if x > 7 { return "", fmt.Errorf("bad escape sequence %q: not a digit", s[:3]) } v = (v << 3) | x diff --git a/mountinfo/mountinfo_linux_test.go b/mountinfo/mountinfo_linux_test.go index 7c060e2f..868bad90 100644 --- a/mountinfo/mountinfo_linux_test.go +++ b/mountinfo/mountinfo_linux_test.go @@ -509,7 +509,7 @@ func TestParseMountinfoWithSpaces(t *testing.T) { Opts: "rw,relatime", Optional: "", Fstype: "cifs", - Source: `//foo/BLA\040BLA\040BLA/`, + Source: `//foo/BLA BLA BLA/`, VfsOpts: `rw,sec=ntlm,cache=loose,unc=\\foo\BLA`, }, {