← Commit list

fce9d7f35

Ron Yorston
Ron Yorston
2026-08-09
SUCCESS Duration: 149s

Subject

shell: correctly count backslashes in read built-in

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iinclude -Iinclude -o applets/usage applets/usage.c

Build Log

(log yok)

Commit Diff GitHub →

shell/ash_test/ash-read/read_n.right+2 -0
@@ -1,3 +1,5 @@
test
tes
tes
+12
+\1
shell/ash_test/ash-read/read_n.tests+2 -0
@@ -1,3 +1,5 @@
echo 'test' | (read reply; echo "$reply")
echo 'test' | (read -n 3 reply; echo "$reply")
echo 'test' | (read -n3 reply; echo "$reply")
+echo '\1\2' | (read -n 2 reply; echo "$reply")
+echo '\1\2' | (read -r -n 2 reply; echo "$reply")
shell/hush_test/hush-read/read_n.right+2 -0
@@ -1,3 +1,5 @@
test
tes
tes
+12
+\1
shell/hush_test/hush-read/read_n.tests+2 -0
@@ -1,3 +1,5 @@
echo 'test' | (read reply; echo "$reply")
echo 'test' | (read -n 3 reply; echo "$reply")
echo 'test' | (read -n3 reply; echo "$reply")
+echo '\1\2' | (read -n 2 reply; echo "$reply")
+echo '\1\2' | (read -r -n 2 reply; echo "$reply")
shell/shell_common.c+1 -1
@@ -279,7 +279,7 @@ shell_builtin_read(struct builtin_read_params *params)
}
put:
bufpos++;
- } while (--nchars);
+ } while (backslash || --nchars);
if (argv[0]) {
/* Remove trailing space $IFS chars */