From: ambar Date: Tue, 15 Sep 1987 16:06:30 +0000 (+0000) Subject: reversed the default of a yes-or-no question; X-Git-Tag: BETA5-24-88~45 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/2c52591fbb8abdad6020cb979126766a988d9ee3?hp=6ec81cbf62701f709b10d42fcdd90e54c53b3ccb reversed the default of a yes-or-no question; changed a call to ds() to use the library's strsave(). --- 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