From bda50e96f047ea9ff447ea57df0b0126734827b1 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 27 Jun 2019 02:11:07 +0200 Subject: [PATCH] Revert "getline: check if newline at the end to not cut end of line" This reverts commit d24be8cf6c6b13ad36743b7f6436b7673424de04. --- os/os.v | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/os/os.v b/os/os.v index 61ab53e0a9..64dcfda16b 100644 --- a/os/os.v +++ b/os/os.v @@ -415,11 +415,7 @@ pub fn get_line() string { if nr_chars == 0 { return '' } - if buf[nr_chars - 1] == `\n` /* newline */ { - return tos(buf, nr_chars - 1) - } - /* To prevent cutting end of line if no newline */ - return tos(buf, nr_chars) + return tos(buf, nr_chars - 1) } pub fn user_os() string {