You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 2050 Reporter: administrator Status: closed (set by @xavierleroy on 2013-08-31T10:46:15Z) Resolution: won't fix Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
I switch between cygwin and linux. I had to write my own input_line that removes
final \013.
I assume this is a crlf/lf-problem. I didn't have this problem in 3.06, but I
guess it depends on where the file was created, so maybe the case didn't occur
earlier.
(** input_line but remove final '\013' which
occurs if files are created on Windows *)
let my_input_line ic =
let str = input_line ic in
if str.[String.length str - 1] = '\013' then
String.sub str 0 (String.length str - 1)
else
str ;;
The text was updated successfully, but these errors were encountered:
You have to know what file format you are using, a computer cannot guess that for you. Usually, the best solution is to write your program to ignore all CR characters in its input.
But it would be a bug for the standard library to do that on all inputs. input_line has no business removing arbitrary characters from the input data.
Original bug ID: 2050
Reporter: administrator
Status: closed (set by @xavierleroy on 2013-08-31T10:46:15Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Mattias
Version: 3.07#2
OS: Mandrake 8.2
Submission from: c-44dd71d5.09-253-7570701.cust.bredbandsbolaget.se (213.113.221.68)
I switch between cygwin and linux. I had to write my own input_line that removes
final \013.
I assume this is a crlf/lf-problem. I didn't have this problem in 3.06, but I
guess it depends on where the file was created, so maybe the case didn't occur
earlier.
(** input_line but remove final '\013' which
occurs if files are created on Windows *)
let my_input_line ic =
let str = input_line ic in
if str.[String.length str - 1] = '\013' then
String.sub str 0 (String.length str - 1)
else
str ;;
The text was updated successfully, but these errors were encountered: