From a2c3333b97582392732adabb017d392ecbebad6e Mon Sep 17 00:00:00 2001 From: Cyclic4179 <147778028+Cyclic4179@users.noreply.github.com> Date: Wed, 27 Mar 2024 07:47:36 +0100 Subject: [PATCH 1/3] fix #10336 --- src/libutil/args.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/args.cc b/src/libutil/args.cc index a981ed9fb..834fc7314 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -285,7 +285,7 @@ void RootArgs::parseCmdline(const Strings & _cmdline, bool allowShebang) std::string line; std::getline(stream,line); - static const std::string commentChars("#/\\%@*-"); + static const std::string commentChars("#/\\%@*-("); std::string shebangContent; while (std::getline(stream,line) && !line.empty() && commentChars.find(line[0]) != std::string::npos){ line = chomp(line); From 6227cd06bd290290769c26ea91c1a6e4720842e3 Mon Sep 17 00:00:00 2001 From: Cyclic4179 <147778028+Cyclic4179@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:55:02 +0100 Subject: [PATCH 2/3] add flakes.sh test for shebang supported types of comments --- tests/functional/flakes/flakes.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index 427290883..14529c475 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -93,6 +93,23 @@ foo EOF chmod +x $nonFlakeDir/shebang-comments.sh +cat > $nonFlakeDir/shebang-different-comments.sh < $nonFlakeDir/shebang-reject.sh <&1 | grepQuiet -F 'error: unsupported unquoted character in nix shebang: *. Use double backticks to escape?' From 9f7b2b93ceb479571e4c0f4bbe587e66528e4ec7 Mon Sep 17 00:00:00 2001 From: Cyclic4179 <147778028+Cyclic4179@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:03:54 +0100 Subject: [PATCH 3/3] fixup! add flakes.sh test for shebang supported types of comments --- tests/functional/flakes/flakes.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index 14529c475..4f41cae0a 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -97,12 +97,13 @@ cat > $nonFlakeDir/shebang-different-comments.sh <