Fixed email address posting - and _ characters

This commit is contained in:
Michiel Broek 2003-08-14 18:28:18 +00:00
parent 6d4d734ff8
commit d68d0d67a0
2 changed files with 35 additions and 34 deletions

View File

@ -34,6 +34,7 @@ v0.37.5 12-Jul-2003 - 10-Aug-2003
set to one hour to support very long scans.
Changed logging during user login.
Fixed bugs in QWK mail upload processing.
Allow - and _ in email names (GetstrU function).
mbsetup:
Added menu entry 1.5.21 for setting maximum allowed logins.

View File

@ -144,45 +144,45 @@ void GetstrC(char *sStr, int iMaxlen)
*/
void GetstrU(char *sStr, int iMaxlen)
{
unsigned char ch = 0;
int iPos = 0;
unsigned char ch = 0;
int iPos = 0;
fflush(stdout);
if ((ttyfd = open ("/dev/tty", O_RDWR|O_NONBLOCK)) < 0) {
perror("open 6");
return;
}
Setraw();
strcpy(sStr, "");
alarm_on();
while (ch != 13) {
fflush(stdout);
if ((ttyfd = open ("/dev/tty", O_RDWR|O_NONBLOCK)) < 0) {
perror("open 6");
return;
}
Setraw();
ch = Readkey();
strcpy(sStr, "");
alarm_on();
while (ch != 13) {
fflush(stdout);
ch = Readkey();
if ((ch == 8) || (ch == KEY_DEL) || (ch == 127)) {
if (iPos > 0) {
printf("\b \b");
sStr[--iPos] = '\0';
} else
putchar('\007');
}
if (isalnum(ch) || (ch == '@') || (ch == '.')) {
if (iPos <= iMaxlen) {
iPos++;
sprintf(sStr, "%s%c", sStr, ch);
printf("%c", ch);
} else
putchar('\007');
}
if ((ch == 8) || (ch == KEY_DEL) || (ch == 127)) {
if (iPos > 0) {
printf("\b \b");
sStr[--iPos] = '\0';
} else
putchar('\007');
}
Unsetraw();
close(ttyfd);
printf("\n");
if (isalnum(ch) || (ch == '@') || (ch == '.') || (ch == '-') || (ch == '_')) {
if (iPos <= iMaxlen) {
iPos++;
sprintf(sStr, "%s%c", sStr, ch);
printf("%c", ch);
} else
putchar('\007');
}
}
Unsetraw();
close(ttyfd);
printf("\n");
}