Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002050OCamlOCaml generalpublic2004-01-21 16:442013-08-31 12:46
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
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: 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 ;;



TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006832)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker