]> git.pond.sub.org Git - empserver/blobdiff - src/client/servcmd.c
Update copyright notice
[empserver] / src / client / servcmd.c
index a8cce6fd44cc3c86a569b7a64ac63043e8afbd1f..12017a19ee6e85fed8aa3a92e7e4b71c86af76e5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2018, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
 #include "proto.h"
 #include "secure.h"
 
-#ifdef HAVE_LIBREADLINE
-#  if defined(HAVE_READLINE_READLINE_H)
-#    include <readline/readline.h>
-#  elif defined(HAVE_READLINE_H)
-#    include <readline.h>
-#  endif /* defined(HAVE_READLINE_H) */
-#endif /* HAVE_LIBREADLINE */
-
 int eight_bit_clean;
 FILE *auxfp;
 int restricted;
@@ -62,7 +54,6 @@ static FILE *redir_fp;
 static int redir_is_pipe;
 static int executing;
 
-static void prompt(int, char *, char *);
 static void doredir(char *p);
 static void dopipe(char *p);
 static int doexecute(char *p);
@@ -89,6 +80,7 @@ servercmd(int code, char *arg, int len)
                (void)fclose(redir_fp);
            redir_fp = NULL;
        }
+       outch('\n');
        prompt(code, the_prompt, teles);
        executing = 0;
        break;
@@ -115,6 +107,7 @@ servercmd(int code, char *arg, int len)
        if (arg[0] != '\n') {
            snprintf(teles, sizeof(teles), "(%.*s) ", len - 1, arg);
            if (!redir_fp) {
+               outch('\n');
                putchar('\07');
                prompt(code, the_prompt, teles);
            }
@@ -135,28 +128,6 @@ servercmd(int code, char *arg, int len)
     return 0;
 }
 
-static void
-prompt(int code, char *prompt, char *teles)
-{
-    char *nl;
-    char pr[1024];
-
-    nl = code == C_PROMPT || code == C_INFORM ? "\n" : "";
-    snprintf(pr, sizeof(pr), "%s%s", teles, prompt);
-#ifdef HAVE_LIBREADLINE
-    rl_set_prompt(pr);
-    printf("%s", nl);
-    rl_forced_update_display();
-#else  /* !HAVE_LIBREADLINE */
-    printf("%s%s", nl, pr);
-    fflush(stdout);
-#endif /* !HAVE_LIBREADLINE */
-    if (auxfp) {
-       fprintf(auxfp, "%s%s%s", nl, teles, prompt);
-       fflush(auxfp);
-    }
-}
-
 static char *
 fname(char *s)
 {