]> andersk Git - moira.git/commitdiff
get more of tty mode to work
authormar <mar>
Thu, 21 Oct 1993 14:54:13 +0000 (14:54 +0000)
committermar <mar>
Thu, 21 Oct 1993 14:54:13 +0000 (14:54 +0000)
clients/mmoira/stubs.c

index 9f9ed88b9182fac3232e2c9b6617192ae5284d0e..5fb155770f3f0fce62139010703b044f80a81869 100644 (file)
@@ -548,6 +548,24 @@ char *text, *helpname;
        XEvent  event;
        XtAppContext _XtDefaultAppContext();
 
+       if (tty) {
+           char buf[256];
+
+           while (1) {
+               printf("%s (Y/N) ", text);
+               fflush(stdout);
+               if (mgets(buf, sizeof(buf)))
+                 return(False);
+               if (buf[0] == 'T' || buf[0] == 't' ||
+                   buf[0] == 'Y' || buf[0] == 'y')
+                 return(True);
+               else if (buf[0] == 'F' || buf[0] == 'f' ||
+                        buf[0] == 'N' || buf[0] == 'n')
+                 return(False);
+               printf("Please answer Yes or No\r\n");
+           }
+       }
+
        if (!yes) {
            yes = XmStringCreate("Yes", XmSTRING_DEFAULT_CHARSET);
            no = XmStringCreate("No", XmSTRING_DEFAULT_CHARSET);
This page took 0.090006 seconds and 5 git commands to generate.