Skip to content

Fix shell detection with multiline commands in thisroot.sh - #23937

Open
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:fix-thisroot-cmdline-newline
Open

guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:fix-thisroot-cmdline-newline

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

A newline in a shell argument makes cut return text from later lines. This can select the wrong setup path and leave ROOTSYS unset.

Read the first line after converting the NUL separators to newlines. Keep reading the stream so long commands also work with pipefail.

Fixes #23746

A newline in a shell argument makes cut return text from later lines.
This can select the wrong setup path and leave `ROOTSYS` unset.

Read the first line after converting the NUL separators to newlines.
Keep reading the stream so long commands also work with pipefail.

Fixes root-project#23746
@guitargeek guitargeek self-assigned this Nov 1, 2026
@guitargeek
guitargeek requested a review from dpiparo as a code owner November 1, 2026 10:56
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 10h 39m 24s ⏱️
 3 883 tests  3 534 ✅   0 💤 349 ❌
76 011 runs  75 260 ✅ 402 💤 349 ❌

For more details on these failures, see this check.

Results for commit 4dd8745.

This branch has not been deployed

No deployments
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.

thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newline

1 participant