You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Syntax-error message quotes the wrong source line: line NUMBER is correct but the printed offending line is the PREVIOUS line's text #204
GNU 5.3.0: probe4.sh: line 2: syntax error near unexpected token ) + probe4.sh: line 2: echo )'rubash: same first line, but the offending-line echo printsprobe4.sh: line 2: echo t1' — the text of line 1.
GNU owner: third_party/bash/parse.y:6859-6861 parser_error() prints the message, and the offending source line is taken from the current parse buffer at the error point; rubash's equivalent appears to read the line buffer before the token that forced the error is appended.
Related to #201 (error-line attribution for multi-line comsub strings / function-body runtime errors) — same diagnostics family, distinct symptom: here the number is right and the TEXT is wrong. Discovered via the zoxide/starship corpus; also visible for the top-level echo ) case (both sides abort rc=2 after the message).
Activity
diag: GNU-exact arithmetic diagnostics, noeval short-circuit parsing, #…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(commit ea792b2c,lane wt/diag)。根因:诊断取行文本时把词法行号当字节偏移用(source_line_at_byte_offset);现按行号取(GNU parse.y:6813-6824 print_offending_line 语义)。探针覆盖 mid-file done、eval 重解析、-c、深层行号四种形态,与 WSL GNU Bash 5.3.0 字节一致。感谢报告!