Skip to content

Fix splitArgs failure with commands containing trailing backslashes#13

Merged
fcying merged 1 commit intomasterfrom
dev
Feb 26, 2026
Merged

Fix splitArgs failure with commands containing trailing backslashes#13
fcying merged 1 commit intomasterfrom
dev

Conversation

@fcying
Copy link
Copy Markdown
Owner

@fcying fcying commented Feb 26, 2026

No description provided.

@fcying fcying merged commit f178115 into master Feb 26, 2026
2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7629391cb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if before, ok :=strings.CutSuffix(line, "\\"); ok {
// If ending with '\', remove '\' and append a space, then continue to read the next line
fullLineBuilder.WriteString(before)
fullLineBuilder.WriteString(" ")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not inject spaces when joining continued lines

Backslash-newline continuation in shell removes the newline without adding whitespace, but this code always appends a literal space before reading the next line. For commands that split a token across lines (for example gcc -c src/fo\ then o.c -o foo.o), the merged string becomes src/fo o.c, which changes argument boundaries and makes fileRegex capture the wrong source file, producing an incorrect compile database entry.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant