Mac - Default Lines Endings - fgets() - no worky
I'm on a Mac running Tiger. I use TextWrangler for basic editing of text files and scripts. I created a simple 2 line text file and saved it with TextWrangler's Text Files encodings set up for Windows (CRLF).
My C program does a fgets(). In the Xcode debugger, I see that the first line has a \r\n as the line endings, as does the second line also on the next fgets().
Then, I changed TextWrangler's preferences to save files in "Mac format", which is just CR. Xcode now tells me the line end character is a \r, and if I dump the file I see a single 0x0D.
However, now fgets() does not respect the single 0x0D as the newline character, and reads to the end of the (very short, two line) file.
What have I done wrong? Why wouldn't fgets() treat the 0x0D as a newline character?