remove multiple trailing newline characters from •GetLine
Windows adds \r\n, and without this the \r stays
This commit is contained in:
parent
8e35241e47
commit
a1e4f9bd6f
@ -931,7 +931,9 @@ B getLine_c1(B t, B x) {
|
||||
if (ln) free(ln);
|
||||
return m_c32(0);
|
||||
}
|
||||
B r = utf8Decode(ln, strlen(ln)-1);
|
||||
u64 len = strlen(ln);
|
||||
while (len && (ln[len-1]=='\r' || ln[len-1]=='\n')) len--;
|
||||
B r = utf8Decode(ln, len);
|
||||
free(ln);
|
||||
return r;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user