Skip to content

Commit c6b1863

Browse files
authored
Merge pull request #118 from cstrachan88/master
Small bugfix in windows raw_console
2 parents ee21404 + e638574 commit c6b1863

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

console/raw_console/main.odin

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ get_password :: proc(allocator := context.allocator) -> string {
2323
fmt.eprintfln("\nError: %v", err)
2424
os.exit(1)
2525

26-
case ch == '\n':
26+
// End line
27+
case ch == '\n': // Posix
28+
fallthrough
29+
case ch == '\r': // Windows
2730
fmt.println()
2831
return string(buf[:])
2932

30-
case ch == '\u007f': // Backspace.
33+
// Backspace
34+
case ch == '\u007f': // Posix
35+
fallthrough
36+
case ch == '\b': // Windows
3137
_, bs_sz := utf8.decode_last_rune(buf[:])
3238
if bs_sz > 0 {
3339
resize(&buf, len(buf)-bs_sz)

0 commit comments

Comments
 (0)