Re: Was: Introduction Code

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 11/14/97

On Friday, November 14, 1997 6:49 AM, Daniel Koepke
[SMTP:dkoepke@CALIFORNIA.COM] wrote:
> On Fri, 14 Nov 1997, j f chaos wrote:
> ->  How on earth did that extra /r get in there(not too familiar w/
> ->fread_string() )
> fread_string() reads "\n" and converts it to "\r\n".  The problem is
> that, then, when you write it out, you have to strip the "\r",
> otherwise it is saved as "\r\n" and next time you read it in,
> fread_string() again converts "\n" to "\r\n", giving you "\r\r\n".
> The more you save without stripping the "\r"s, the more "\r"s get
> added.
> Now, what I am not understanding is how George is going to side-step
> this?  You should write out the "\r\n" pair over telnet, but you
> should only write "\n" to files.  I fail to see how changing
> fread_string() will produce the desired results and meet the two above
> "requirements".
I can tell you how I solved it.

Convert each and every string that is written to disk to not have \r's in it.
Convert each and every string that is read from disk to have a \r\n pair
for each \n in the file. In addition, yank any \r's before the \n's are

Takes a bit more time, but it does make my life easier. It also works
across win/unix so I can untar my backup on my win95 pc and
fire up the test mud on it.


Neither sweat, nor blood, nor frustration, nor lousy manuals
nor missing parts, nor wrong parts shall keep me from my task.
  --Christopher Hicks

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST