www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - strange din.readLine() behavior on linux (apache cgi)

Hi,
I've been working on a CGI web framework and ran into some unexpected 
behavior from din.readLine when looping through a data stream coming in 
from a multipart form web request. It seems that it is adding an extra 
blank line after each expected line. This could be due to bad code 
splitting the line at the CR and then again at the LF instead of seeing 
that as one EOL sequence. According to the docs, this doesn't seem like 
the correct behavior. when I output the data reading in character by 
character, everything looks correct. Here is the code:

while (!din.eof)
{
     line = din.readLine();
     ...
}

I am running the DMD compiler on fedora core linux using Phobos. Any 
ideas? Is this how it's supposed to work or is there something I'm doing 
wrong?

Thanks much for any help,
-Justin
Nov 25 2007