color(COLOR_POP);
stty_ctdl(0);
b=inkey();
- for (a=0; a<strlen(ipc->ServInfo.moreprompt); ++a)
+ for (a=0; !IsEmptyStr(&ipc->ServInfo.moreprompt[0]); ++a)
scr_putc(' ');
scr_putc(13);
stty_ctdl(1);
}
user->axlevel = intprompt("Access level", user->axlevel, 0, 6);
-
- user->flags = set_attr(ipc, user->flags,
+/* user->flags = set_attr(ipc, user->flags,
"Permission to send Internet mail",
- US_INTERNET, 0);
-
+ US_INTERNET, 0); */
+ if (boolprompt("Permission to send Internet mail", (user->flags & US_INTERNET)))
+ user->flags |= US_INTERNET;
+ else
+ user->flags &= ~US_INTERNET;
if (boolprompt("Ask user to register again", !(user->flags & US_REGIS)))
user->flags &= ~US_REGIS;
else
"Be unlisted in userlog",
US_UNLISTED, 0);
- if (strlen(editor_paths[0]) > 0) {
+ if (!IsEmptyStr(editor_paths[0])) {
user->flags = set_attr(ipc, user->flags,
"Always enter messages with the full-screen editor",
US_EXTEDIT, 0);
/* Searches for patn in search string */
int pattern(char *search, char *patn) {
- int a,b;
-
- for (a=0; a<strlen(search); ++a) {
- b=strncasecmp(&search[a],patn,strlen(patn));
+ int a,b,len;
+
+ len = strlen(patn);
+ for (a=0; !IsEmptyStr(&search[a]); ++a) {
+ b=strncasecmp(&search[a],patn,len);
if (b==0) return(b);
}
return(-1);
{
int a;
- if (strlen(string)==0) return;
+ if (IsEmptyStr(string)) return;
/* Convert non-printable characters to blanks */
- for (a=0; a<strlen(string); ++a) {
+ for (a=0; !IsEmptyStr(&string[a]); ++a) {
if (string[a]<32) string[a]=32;
if (string[a]>126) string[a]=32;
}
pclose(who);
b = 0;
- for (a=0; a<strlen(buf); ++a) {
+ for (a=0; !IsEmptyStr(&buf[a]); ++a) {
if ((buf[a]=='(')||(buf[a]==')')) ++b;
}
if (b<2) {
if (buf[a]==')') buf[a] = 0;
}
- if (strlen(buf)==0) strcpy(hbuf, ipc->ServInfo.fqdn);
+ if (IsEmptyStr(buf)) strcpy(hbuf, ipc->ServInfo.fqdn);
else strncpy(hbuf,buf,24);
#else
char *tty = ttyname(0);