diff --git a/README.md b/README.md index ccece431f2d25c064baee628f5a509216f3f7e72..0d78724b0e1f893991e44570711cb7a6b59ac920 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![loc](https://sloc.xyz/github/nektro/zig-inquirer) [![license](https://img.shields.io/github/license/nektro/zig-inquirer.svg)](https://github.com/nektro/zig-inquirer/blob/master/LICENSE) [![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro) -[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/) +[![Zig](https://img.shields.io/badge/Zig-0.16-f7a41d)](https://ziglang.org/) [![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod) A collection of utilities for prompting information from the user on the CLI diff --git a/src/lib.zig b/src/lib.zig index 2c393665b4117d6c17ea3d76516c4ac240daaf2e..5c66ffb27679c393598b0f7d3cc402f871f00b9d 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -19,7 +19,7 @@ fn doprompt(out: anytype, in: anytype, alloc: std.mem.Allocator, default: ?[]con while (true) : (n += 1) { try out.print(comptime ansi.color.Faint("> "), .{}); var input: []const u8 = try in.readUntilDelimiterAlloc(alloc, '\n', 1024); - input = std.mem.trimRight(u8, input, "\r\n"); + input = std.mem.trimEnd(u8, input, "\r\n"); if (input.len == 0) if (default) |d| { value = d;