[crossfire] LF vs CRLF

Mark Wedel mwedel at sonic.net
Sat Dec 16 23:43:53 CST 2006


Alex Schultz wrote:

> Finally, there is also the option of making the server handle both LF
> and CRLF style line endings. IMHO this is the best option for a long
> term  and proper solution. I'm not sure off hand how easy this would be
> with lex though.

  The lex code probably has an option to say what the line separator are.

  However, that is only 1 piece of the puzzle:
- load_map_header uses fgets and has various bits of code that looks for newline 
- that may need to be modified.

- The java editor would have to be modified, as it has its own loader logic 
(maybe that handles either way by default - don't know.

- There may be other bits of code here and there that would have issues.  Off 
the top of my head, anything that reads data from files might have issues - this 
would include the treasure code, artifacts code, messages, settings, etc.  While 
a CRLF style will be read in correctly, it may mean that strings would have 
tailing CR's when they should (the load code removes the LF, but would have to 
be modified to also potentially remove the CR).  In some cases, that wouldn't be 
a big deal (code is just doing an atoi on the string, so if it has a newline, 
not a big deal).  However, if that isn't removed for things like object names, 
then it wouldn't be able to find archetypes, etc.

- Even if the code is modified, still have to make sure that things don't change 
to quickly - if code changes are made, and then immediately some CRLF things are 
checked in, then people that update the maps but not the server could have 
problems, etc.




More information about the crossfire mailing list