summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 978ce707..b79b1ab8 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -250,7 +250,10 @@ pub fn captured(p: *Pardes, req: Req, id: usize, exec: bool, text: []const u8, i
/// there (`no such`, `not found`, the words 9ns reads as ENOENT too), else
/// EIO.
fn failureErrno(failure: []const u8) u16 {
- return if (std.mem.indexOf(u8, failure, "no such") != null or std.mem.indexOf(u8, failure, "not found") != null) E.NOENT else E.IO;
+ if (std.mem.indexOf(u8, failure, "no such") != null or std.mem.indexOf(u8, failure, "not found") != null) return E.NOENT;
+ // A pattern refused (Edit's too) is malformed input, as 9ns reads it.
+ if (std.mem.indexOf(u8, failure, "bad regular expression") != null) return E.INVAL;
+ return E.IO;
}
pub fn resultsLen(p: *Pardes) u64 {