]> git.pond.sub.org Git - empserver/commitdiff
Simplify getele()
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Jul 2008 19:50:15 +0000 (15:50 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 21 Jul 2008 12:13:40 +0000 (08:13 -0400)
No need to check player->aborted(), checking value of uprmptrd()
suffices.

src/lib/subs/getele.c

index ee5ac4b30379f0b8ba0b12a280c3c7c8ba105568..5fa442bced0430c6ffec77e79b41487d02da2671 100644 (file)
@@ -56,7 +56,7 @@ getele(char *recipient, char *buf)
     pr("undo last line with ~u, print with ~p, abort with ~q, end with ^D or .\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;
@@ -93,8 +93,6 @@ getele(char *recipient, char *buf)
            bp += len;
        }
     }
-    if (player->aborted)
-       return -1;
     return bp - buf;
 }