Skip to content

Fix: handle filenames with spaces in kernbench script#1299

Open
kumarsgoyal wants to merge 1 commit intolinux-test-project:masterfrom
kumarsgoyal:fix-cat-error-in-kernbench-1
Open

Fix: handle filenames with spaces in kernbench script#1299
kumarsgoyal wants to merge 1 commit intolinux-test-project:masterfrom
kumarsgoyal:fix-cat-error-in-kernbench-1

Conversation

@kumarsgoyal
Copy link
Copy Markdown

Fix: handle filenames with spaces in kernbench script

Update the kernel source caching loop to correctly handle filenames
containing spaces, newlines, and other special characters.

The previous implementation used a for loop over backtick-evaluated
find, which relied on word splitting and broke on filenames with
whitespace. This resulted in errors such as:

cat: ./tools/testing/selftests/devices/probe/boards/Dell: No such file or directory
cat: Inc.,XPS: No such file or directory

Replace the loop with a null-delimited find pipeline using
-print0 and read -r -d '', ensuring all valid filenames are
processed safely.

Signed-off-by: Sahil Kumar kumar.sgoyal@gmail.com

Update the kernel source caching loop to correctly handle filenames
containing spaces, newlines, and other special characters.

The previous implementation used a for loop over backtick-evaluated
`find`, which relied on word splitting and broke on filenames with
whitespace. This resulted in errors such as:

    cat: ./tools/testing/selftests/devices/probe/boards/Dell: No such file or directory
    cat: Inc.,XPS: No such file or directory

Replace the loop with a null-delimited `find` pipeline using
`-print0` and `read -r -d ''`, ensuring all valid filenames are
processed safely.

Signed-off-by: Sahil Kumar <kumar.sgoyal@gmail.com>
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