Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002050OCaml~DO NOT USE (was: OCaml general)public2004-01-21 16:442013-08-31 12:46
Assigned To 
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002050: input_line keeps ending \013
DescriptionFull_Name: Mattias
Version: 3.07#2
OS: Mandrake 8.2
Submission from: (

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

(** 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)
    str ;;

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2012-01-27 20:05

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.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2012-01-27 20:05 doligez Note Added: 0006832
2012-01-27 20:05 doligez Status acknowledged => resolved
2012-01-27 20:05 doligez Resolution open => won't fix
2012-01-27 20:05 doligez Description Updated View Revisions
2013-08-31 12:46 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker