*/
#include <h/mh.h>
+#include <ctype.h>
int
gans(char *prompt, struct swit *ansp)
{
- register int i;
- register char *cp;
- register struct swit *ap;
+ int i;
+ char *cp;
+ struct swit *ap;
char ansbuf[BUFSIZ];
for (;;) {
if (i == EOF)
return 0;
if (cp < &ansbuf[sizeof ansbuf - 1]) {
-#ifdef LOCALE
- i = (isalpha(i) && isupper(i)) ? tolower(i) : i;
-#else
- if (i >= 'A' && i <= 'Z')
- i += 'a' - 'A';
-#endif
- *cp++ = i;
+ *cp++ = tolower(i);
}
}
*cp = '\0';