Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 2 Sep 2010 21:33:34 +0000 (23:33 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 2 Sep 2010 21:33:34 +0000 (23:33 +0200)
citadel/textclient/citadel.c
citadel/textclient/screen.c

index 9cd482eea0ef3ec4c559a2f74f602dcd0882d6f7..8d730855eda712dea9079c2ef6a00c8d07f6acfb 100644 (file)
@@ -75,8 +75,8 @@
 #define IFNAIDE if (axlevel<AxAideU)
 
 int rordercmp(struct ctdlroomlisting *r1, struct ctdlroomlisting *r2);
-
 march *marchptr = NULL;
+extern char *moreprompt;
 
 /* globals associated with the client program */
 char temp[PATH_MAX];           /* Name of general-purpose temp file */
@@ -1018,7 +1018,7 @@ void system_info(CtdlIPC *ipc)
        mrtg_active_users = extract_int(resp, 0);
        remove_token(resp, 0, '\n');
        extract_token(mrtg_server_uptime, resp, 0, '\n', sizeof mrtg_server_uptime);
-    free(resp);
+       free(resp);
        resp = NULL;
 
        /* get high message# */
@@ -1150,6 +1150,7 @@ void get_serv_info(CtdlIPC *ipc, char *supplied_hostname)
        char buf[SIZ];
 
        CtdlIPCServerInfo(ipc, buf);
+       moreprompt = ipc->ServInfo.moreprompt;
 
        /* be nice and identify ourself to the server */
        CtdlIPCIdentifySoftware(ipc, SERVER_TYPE, 0, REV_LEVEL,
index 8229c63d3bfb5a06f2998e26048e5618a910533b..1e0abb0283c898a1fda0ba2f4d676d6e444d6ab2 100644 (file)
@@ -22,6 +22,9 @@
 
 char arg_screen;
 
+/* the default paginator prompt will be replaced by the server's prompt when we learn it */
+char *moreprompt = " -- more -- ";
+
 extern int screenheight;
 extern int screenwidth;
 int lines_printed = 0;
@@ -99,29 +102,25 @@ int scr_getc(int delay)
  * Issue the paginator prompt (more / hit any key to continue)
  */
 void hit_any_key(void) {
-       int b;
+       int a, b;
 
        color(COLOR_PUSH);
        color(DIM_RED);
-       /* scr_printf("%s\r", ipc->ServInfo.moreprompt); */
-       scr_printf("<<more>>\r");       // FIXME use the prompt given by the server
+       scr_printf("%s\r", moreprompt);
        color(COLOR_POP);
-       stty_ctdl(0);
        b=inkey();
-       /*
-       for (a=0; !IsEmptyStr(&ipc->ServInfo.moreprompt[a]); ++a)
+       for (a=0; a<screenwidth; ++a) {
                scr_putc(' ');
-       */
-       scr_printf("        ");
-       scr_putc(13);
-       stty_ctdl(1);
-
-       if ( (rc_prompt_control == 1)
-          || ((rc_prompt_control == 3) && (userflags & US_PROMPTCTL)) ) {
-               if (b == 'q' || b == 'Q' || b == 's' || b == 'S')
+       }
+       scr_printf("\r");
+
+       if ( (rc_prompt_control == 1) || ((rc_prompt_control == 3) && (userflags & US_PROMPTCTL)) ) {
+               if (b == 'q' || b == 'Q' || b == 's' || b == 'S') {
                        b = STOP_KEY;
-               if (b == 'n' || b == 'N')
+               }
+               if (b == 'n' || b == 'N') {
                        b = NEXT_KEY;
+               }
        }
 
        if (b==NEXT_KEY) sigcaught = SIGINT;