From 2c52591fbb8abdad6020cb979126766a988d9ee3 Mon Sep 17 00:00:00 2001 From: ambar Date: Tue, 15 Sep 1987 16:06:30 +0000 Subject: [PATCH] reversed the default of a yes-or-no question; changed a call to ds() to use the library's strsave(). --- clients/mailmaint/mailmaint.c | 39 ++++++++++++----------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/clients/mailmaint/mailmaint.c b/clients/mailmaint/mailmaint.c index d69bb4b0..83b1a0d8 100644 --- a/clients/mailmaint/mailmaint.c +++ b/clients/mailmaint/mailmaint.c @@ -5,7 +5,6 @@ #ifndef lint static char rcsid_mailmaint_c[] = "$Header$"; - #endif lint /***********************************************************************/ @@ -35,7 +34,7 @@ static char rcsid_mailmaint_c[] = "$Header$"; static char *whoami; static int status; static void scream(); -char *ds(); +extern char *strsave(); typedef struct list_info { char *acl; @@ -107,7 +106,7 @@ main(argc, argv) uname = getpwuid((int) getuid())->pw_name; } - uname = (uname && strlen(uname)) ? ds(uname) : ""; + uname = (uname && strlen(uname)) ? strsave(uname) : ""; printf("Connecting to database for %s...please hold on.\n", uname); @@ -439,16 +438,19 @@ show_all() { char c; - show_text(DISPROW, STARTCOL, "This function may take a while...proceed[y]?"); + show_text(DISPROW, STARTCOL, "This function may take a \ +while... proceed? [y] "); c = getchar(); - if (c == 'n' || c == 'N') { - erase_line(DISPROW, STARTCOL); - return; + if (c == 'y' || c == 'Y') { + move(DISPROW + 1, STARTCOL); + addstr("Processing query...please hold"); + refresh(); + (void) list_all_groups(); } - move(DISPROW + 1, STARTCOL); - addstr("Processing query...please hold"); - refresh(); - (void) list_all_groups(); + else + erase_line(DISPROW, STARTCOL); + return; + } /****************************************************/ @@ -899,21 +901,6 @@ Prompt(prompt, buf, buflen) return(0); } -/* - * duplicate string - */ -char * -ds(str) - char *str; -{ - register char *newstr = malloc((unsigned) strlen(str) + 1); - - if (newstr == (char *) NULL) - return ((char *) NULL); - else - return (strcpy(newstr, str)); -} - /* * Local Variables: * mode: c -- 2.45.2