From 6122159572f1cc950666df484e2074cf32f22eb5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 16:51:34 -0300 Subject: A 9P look keeps its leading blanks: an indented line, or blanks alone, is looked for as written Every line written to look or exec went through Messages.next, which trimmed blanks from both ends. A look of ` indented` then found the first bare `indented`, and a diff's blank context line ` ` looked at nothing. A look's line is now its text: only its `\r` and newline go. lookAt keeps the blanks for the word search too; it expands `~` only for a look that starts with one, and the path, address and command readings trim for themselves as before. runSearch keeps a pattern's blanks, since a builtin's argument comes trimmed already. An exec line is trimmed as before. fs.md says so. Co-Authored-By: Claude Opus 5.5 --- test/monkey9p.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/monkey9p.py b/test/monkey9p.py index 89751145..64b82832 100644 --- a/test/monkey9p.py +++ b/test/monkey9p.py @@ -698,8 +698,13 @@ def allowances(res, path, data, sizes, room): (acme's xfid.c:842) or run as the Look builtin; an Edit block whose text never ended runs, and fails, at the close.""" base = path.rsplit('/', 1)[-1] - lines = [line for line in served_lines(data, sizes, room) if line.strip()] - if base in ('look', 'event'): + served = served_lines(data, sizes, room) + lines = [line for line in served if line.strip()] + if base == 'look': + # A look's line is its text, blanks and all: one of blanks alone + # is a look too (fs.md); only an empty one (or a lone \r) is none. + n = len([line for line in served if line.rstrip(b'\r')]) + elif base == 'event': n = len(lines) elif base in ('exec', 'ctl', 'tagexec'): n = sum(1 for line in lines if line.split()[:1] == [b'Look']) -- cgit v1.3