On Sun, 27 Sep 1998, Erwin S. Andreasen wrote:
> /* find the end of this line */
> while (ISNEWL(*nl_pos))
> nl_pos++;
>
>
>It should only skip one complete newline. The problem is however, finding
>out what a newliny IS. It could be \n, but perhaps also \r\n or \n\r or
>\r.
Right. Assuming the telnet-correct codes, the following would work:
diff -u stk/comm.c nl/comm.c
--- stk/comm.c Fri Jul 3 15:07:39 1998
+++ nl/comm.c Sun Sep 27 22:59:12 1998
@@ -1664,7 +1664,12 @@
write_to_q(tmp, &t->input, 0);
/* find the end of this line */
+#if 0
while (ISNEWL(*nl_pos))
+#endif
+ if (ISNEWL(*nl_pos))
+ nl_pos++;
+ if (ISNEWL(*nl_pos))
nl_pos++;
/* see if there's another newline in the input buffer */
That'd also work for \n\r but break on a simple \r or \n.
--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://mouse.van.ml.org/ (mostly) | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/ | -- Elbert Hubbard
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST