protz / ocaml-installer

The official windows installer (built using NSIS) for OCaml
http://protz.github.com/ocaml-installer/
GNU General Public License v3.0
66 stars 11 forks source link

`ocamlc -where` appends `^M` to the end of the output #27

Closed JasonGross closed 10 years ago

JasonGross commented 10 years ago
$ ocamlc -where > foo; cat -v foo
D:/OCaml/lib^M

This also happens with the precompiled gtk+, and I haven't figured out why yet, so it might not be an issue with the installer, but with my installation. But then again, it might be a problem with the installer, so I figured I'd submit a report here.

protz commented 10 years ago

(^M is \r, the carriage return ; line separators on Windows are \r\n while they are \n on Unix.)

Well I would assume that this is the normal behavior : ocamlc is a Windows program, so it uses native windows line endings. The fact that you're seeing the ^M is probably because you're using the Cygwin shell, which expects \n, isn't it? Or maybe is there an extra ^M in addition to an already-existing \r\n ?

JasonGross commented 10 years ago

I think it has something to do with where I install it and how I call it; if I call it using a windows style path (C:...), then I get the ^M. If I put it in the cygwin folder and call it with a linux-style path (/OCaml/...), I don't. I'm closing this issue, since I think it's probably a problem with cygwin, or my installation or setup.

protz commented 10 years ago

The variable is $OCAMLLIB, maybe cygwin mangles somehow with these variables?