mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Revert "Revert "getline: check if newline at the end to not cut end of line""
This reverts commit bda50e96f0
.
This commit is contained in:
parent
b9011804fc
commit
fc7ac25a98
6
os/os.v
6
os/os.v
@ -415,7 +415,11 @@ pub fn get_line() string {
|
||||
if nr_chars == 0 {
|
||||
return ''
|
||||
}
|
||||
return tos(buf, nr_chars - 1)
|
||||
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)
|
||||
}
|
||||
|
||||
pub fn user_os() string {
|
||||
|
Loading…
Reference in New Issue
Block a user