summaryrefslogtreecommitdiffstats
path: root/tests/posix/exec_substring_plus.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-10-23 11:34:49 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-10-27 17:25:15 -0400
commit1f9776901b86b97bbb9c16dd814aeab27eea0e25 (patch)
treee39261c058a62dcea3c2bb654361967cd65850b4 /tests/posix/exec_substring_plus.sh
parent60451f4f0817250d643d7225198003b1ed3c5bb0 (diff)
downloadbfs-1f9776901b86b97bbb9c16dd814aeab27eea0e25.tar.xz
tests/posix: Add a test for overly aggressive -exec {} + matching
Link: https://savannah.gnu.org/bugs/?66365
Diffstat (limited to 'tests/posix/exec_substring_plus.sh')
-rw-r--r--tests/posix/exec_substring_plus.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/posix/exec_substring_plus.sh b/tests/posix/exec_substring_plus.sh
new file mode 100644
index 0000000..90309b0
--- /dev/null
+++ b/tests/posix/exec_substring_plus.sh
@@ -0,0 +1,14 @@
+# https://pubs.opengroup.org/onlinepubs/9799919799/utilities/find.html
+#
+# Only a <plus-sign> that immediately follows an argument containing only
+# the two characters "{}" shall punctuate the end of the primary expression.
+# Other uses of the <plus-sign> shall not be treated as special.
+# ...
+# If a utility_name or argument string contains the two characters "{}", but
+# not just the two characters "{}", it is implementation-defined whether
+# find replaces those two characters or uses the string without change.
+
+invoke_bfs basic -exec printf '%s %s %s %s\n' {} {}+ +{} + \; | sed 's/ .*//' >"$OUT"
+sort_output
+diff_output
+