Carriage return/Line feed / space at end of line

Frank Warmerdam warmerdam at POBOX.COM
Wed Nov 9 14:51:27 EST 2005

On 11/9/05, Huub <hfl at> wrote:
> Hi,
> A map file that looks like this in any editor
> (...)
>        DATA            "the_geom from (
>                         select shapes.id_vsrg
>                           , round(area(the_geom)) as opp
>                           , address.ovb_regnr
>                           , addressverh.ovb_regnr
>                           , addressrheb.ovb_regnr
>                           , address.gebdat
>                           , vg_vsrgebieden.naam
>                           , tdn_code
>                           , round(x(centre)) as xcent
>                           , round(y(centre)) as ycent
>                           , shapes.oid as oid
>                           , shapes.the_geom as the_geom
>                         from shapes
>                         inner join vg_vsr
>                           on = ..."
> (...)
> can cause mapserv to crash (on linux):
> This has something to do with linefeeds and carriage returns:
> a single white space at the end of every file seems to be necessary
> If you edit a mapfile on windows and then copy it to a linux machine
> there is the danger that this white space is not there
> a acsii 10 (\n or LF ) is not considered to be whitespace it seems.
> a ascii 13 (\r or CR) is considered to be whitspace.
> If you have to move from windows to linux, and try to remove first these
> ^M signals that appear in VI, messes things op.
> How can this happen? Shouldn't a \n or  \r\n or \r be treated the same
> in a platform independent product?
> Is this a bug?
> The mapserver version that i'm talking about is linux (debian) 4.4.1
> Is it better in 4.6.1?


If this is still the case, then it is a bug we would want to fix.
I would ask that you try and verify the problem with MapServer 4.8beta1
and if it still occurs file a bug.  Please attach a zipped mapfile causing
the problem to the bug, and point us to the binaries you encountered
the bug with.

It seems to me these low level details are taken care of by the lexer
file reading code but if there is a problem I imagine we can do
something about it.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at
light and sound - activate the windows |
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the mapserver-dev mailing list