]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/getele.c
Update copyright notice
[empserver] / src / lib / subs / getele.c
index 68da396167efc0668e486cde3793cab3ee6c05ff..eb13f9179d3f3b09ea8e6d4b6f5ac8427bdf8ce8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
  *  ---
  *
  *  getele.c: Read a telegram from a file or stdin and send it to a country
- * 
+ *
  *  Known contributors to this file:
- *    
+ *     Ron Koenderink, 2005
+ *     Markus Armbruster, 2005-2009
+ *
  */
 
 #include <config.h>
 
-#include <ctype.h>
-#include "misc.h"
 #include "player.h"
-#include "tel.h"
 #include "prototypes.h"
+#include "tel.h"
 
 static int tilde_escape(char *s);
 
@@ -55,14 +55,14 @@ getele(char *recipient, char *buf)
     char left[16];
 
     pr("Enter telegram for %s\n", recipient);
-    pr("undo last line with ~u, print with ~p, abort with ~q, end with ^D or .\n");
+    pr("undo last line with ~u, print with ~p, abort with ~q, end with .\n");
     bp = buf;
     *bp = 0;
-    while (!player->aborted) {
+    for (;;) {
        sprintf(left, "%4d left: ", (int)(buf + MAXTELSIZE - bp));
        if (uprmptrd(left, buffer, sizeof(buffer) - 2) <= 0)
            return -1;
-       switch(tilde_escape(buffer)) {
+       switch (tilde_escape(buffer)) {
        case 'q':
            return -1;
        case 'u':
@@ -95,8 +95,6 @@ getele(char *recipient, char *buf)
            bp += len;
        }
     }
-    if (player->aborted)
-       return -1;
     return bp - buf;
 }