summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/look.zig2
-rw-r--r--src/ninep/ctl.zig3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/look.zig b/src/look.zig
index cfebd42d..92e711fa 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1266,7 +1266,7 @@ fn addressed(tok: []const u8) ?struct { path: []const u8, expr: []const u8 } {
// pattern in the address may (`calc.py:/return a/`).
if (std.mem.indexOfAny(u8, tok[0..colon], " \t") != null) return null;
if (std.mem.indexOfAny(u8, expr, " \t") != null and std.mem.indexOfAny(u8, expr, "/?") == null) return null;
- if (expr.len == 0 or std.mem.indexOfScalar(u8, "0123456789+-/$.#,;", expr[0]) == null) return null;
+ if (expr.len == 0 or std.mem.indexOfScalar(u8, "0123456789+-/?$.#,;", expr[0]) == null) return null;
if (std.ascii.isDigit(expr[0])) {
const pl = parsePathLine(tok);
if (pl.at.line != 0 and pl.end == tok.len) return null;
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index acb1b934..02201de0 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1951,6 +1951,9 @@ test "@p<serial>:<address> takes any sam address; a miss and an unknown serial a
.{ .addr = "#12,#15", .want = " 12 15 " },
.{ .addr = "$", .want = " 16 16 " },
.{ .addr = "1,2", .want = " 0 16 " },
+ // Backward, as in addr: from the dot's start, wrapping to the last.
+ .{ .addr = "?foo?", .want = " 6 9 " },
+ .{ .addr = "$-?y?", .want = " 10 11 " },
}) |c| {
var line: [64]u8 = undefined;
try testing.expectEqual(Status.ok, wr(p, root, try std.fmt.bufPrint(&line, "@p{d}:{s}\n", .{ serial, c.addr })).reply.status);