Deleted Added
full compact
msg.c (379) msg.c (1338)
1#ifndef lint
1#ifndef lint
2static const char *rcsid = "$Id: msg.c,v 1.3 1993/09/04 05:06:50 jkh Exp $";
2static const char *rcsid = "$Id: msg.c,v 1.2 1993/09/03 23:01:15 jkh Exp $";
3#endif
4
5/*
6 * FreeBSD install - a package for the installation and maintainance
7 * of non-core utilities.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions

--- 64 unchanged lines hidden (view full) ---

75 va_start(args, msg);
76 /*
77 * Need to open /dev/tty because file collection may have been
78 * collected on stdin
79 */
80 tty = fopen("/dev/tty", "r");
81 if (!tty)
82 barf("Can't open /dev/tty!\n");
3#endif
4
5/*
6 * FreeBSD install - a package for the installation and maintainance
7 * of non-core utilities.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions

--- 64 unchanged lines hidden (view full) ---

75 va_start(args, msg);
76 /*
77 * Need to open /dev/tty because file collection may have been
78 * collected on stdin
79 */
80 tty = fopen("/dev/tty", "r");
81 if (!tty)
82 barf("Can't open /dev/tty!\n");
83 while (ch != 'Y' && ch != 'N') {
83 while (ch != 'Y' && ch != 'N') {
84 vfprintf(stderr, msg, args);
85 if (def)
86 fprintf(stderr, " [yes]? ");
87 else
88 fprintf(stderr, " [no]? ");
89 fflush(stderr);
84 vfprintf(stderr, msg, args);
85 if (def)
86 fprintf(stderr, " [yes]? ");
87 else
88 fprintf(stderr, " [no]? ");
89 fflush(stderr);
90 ch = toupper(fgetc(tty));
90 if (AutoAnswer) {
91 ch = (AutoAnswer == YES) ? 'Y' : 'N';
92 fprintf(stderr, "%c\n", ch);
93 }
94 else
95 ch = toupper(fgetc(tty));
91 if (ch == '\n')
92 ch = (def) ? 'Y' : 'N';
93 }
94 return (ch == 'Y') ? TRUE : FALSE;
95}
96
97
96 if (ch == '\n')
97 ch = (def) ? 'Y' : 'N';
98 }
99 return (ch == 'Y') ? TRUE : FALSE;
100}
101
102