Carriage return/Line feed / space at end of line

Huub hfl at HOME.NL
Wed Nov 9 11:37:27 EST 2005


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?


More information about the mapserver-dev mailing list