Skip to content

Commit

Permalink
fix: make_enter_dir support ` "
Browse files Browse the repository at this point in the history
  • Loading branch information
fcying committed Aug 30, 2024
1 parent 5087b27 commit 9aad952
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/compiledb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/urfave/cli/v2"
)

var Version string = "v1.3.1"
var Version string = "v1.3.2"

func init() {
log.SetOutput(os.Stdout)
Expand Down
2 changes: 1 addition & 1 deletion internal/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var compile_regex *regexp.Regexp
var file_regex *regexp.Regexp

// Leverage `make --print-directory` option
var make_enter_dir = regexp.MustCompile(`^\s?make.*?: Entering directory .*'(.*)'$`)
var make_enter_dir = regexp.MustCompile(`^\s?make.*?: Entering directory .*['"` + "`" + `](.*)['"` + "`" + `]$`)
var make_leave_dir = regexp.MustCompile(`^\s?make.*?: Leaving directory .*'(.*)'$`)

// We want to skip such lines from configure to avoid spurious MAKE expansion errors.
Expand Down
4 changes: 3 additions & 1 deletion tests/build.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
make: Entering directory 'out/test'
make: Entering directory 'out/test"

clang -fno-common -MM -MT objs/main1.c.o main1.c -o objs/main1.c.d

Expand All @@ -17,3 +17,5 @@ gcc -c /opt/fullpath.c -o objs/fullpath.c.o


make: Leaving directory 'out/test'

make[1]: Entering directory `/home/test/src/algorithm"

0 comments on commit 9aad952

Please sign in to comment.