| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const io = std.io; |
| 3 | | const str = std.str; |
| 3 | const mem = std.mem; |
| 4 | 4 | |
| 5 | 5 | pub fn main(args: [][]u8) -> %void { |
| 6 | 6 | const exe = args[0]; |
| 7 | 7 | var catted_anything = false; |
| 8 | 8 | for (args[1...]) |arg| { |
| 9 | | if (str.eql(arg, "-")) { |
| 9 | if (mem.eql(u8, arg, "-")) { |
| 10 | 10 | catted_anything = true; |
| 11 | 11 | %return cat_stream(&io.stdin); |
| 12 | 12 | } else if (arg[0] == '-') { |
| ... | ... | @@ -38,7 +38,7 @@ fn cat_stream(is: &io.InStream) -> %void { |
| 38 | 38 | var buf: [1024 * 4]u8 = undefined; |
| 39 | 39 | |
| 40 | 40 | while (true) { |
| 41 | | const bytes_read = is.read(buf) %% |err| { |
| 41 | const bytes_read = is.read(buf[0...]) %% |err| { |
| 42 | 42 | %%io.stderr.printf("Unable to read from stream: {}\n", @errorName(err)); |
| 43 | 43 | return err; |
| 44 | 44 | }; |