From: Art Cancro Date: Thu, 30 Jul 1998 00:50:11 +0000 (+0000) Subject: Changed all of the proprietary strucmp() and struncmp() calls to the more X-Git-Tag: v7.86~8413 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=67fdaae3e1809b44c9087d8118ee2c8c5ecd4851;p=citadel.git Changed all of the proprietary strucmp() and struncmp() calls to the more standardized strcasecmp() and strncasecmp(), EXCEPT in the client. The client was left alone in order to allow it to be more portable -- strcasecmp() is on most systems these days, but it's still not universal. --- diff --git a/citadel/citadel.h b/citadel/citadel.h index 05c9b9dd7..ff9fc30d7 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -14,9 +14,10 @@ #undef tolower #define tolower(x) ( ((x>='A')&&(x<='Z')) ? (x+'a'-'A') : x ) -#define strucmp(lstr,rstr) struncmp(lstr,rstr,32767) #define NEW_CONFIG +#define strucmp(lstr,rstr) struncmp(lstr,rstr,32767) + /* * The only typedef we do is an 8-bit unsigned, for screen dimensions. * All other defs are done using standard C types. The code assumes that diff --git a/citadel/citmail.c b/citadel/citmail.c index 2f4a12cc4..849871387 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -55,21 +55,6 @@ char TABLEFILE[128]; char OUTGOING_FQDN[128]; int RUN_NETPROC = 1; -int struncmp(lstr,rstr,l) -char lstr[],rstr[]; { - int pos = 0; - char lc,rc; - while (1) { - if (pos==l) return(0); - lc=tolower(lstr[pos]); - rc=tolower(rstr[pos]); - if ((lc==0)&&(rc==0)) return(0); - if (lcrc) return(1); - pos=pos+1; - } - } - long conv_date(sdbuf) char sdbuf[]; { int a,b,cpos,tend,tval; @@ -185,7 +170,7 @@ void host_alias(char host[]) { int a; /* What name is the local host known by? */ - /* if (!strucmp(host, config.c_fqdn)) { */ + /* if (!strcasecmp(host, config.c_fqdn)) { */ if (IsHostLocal(host)) { strcpy(host, config.c_nodename); return; @@ -193,7 +178,7 @@ void host_alias(char host[]) { /* Other hosts in the gateway domain? */ for (a=0; a 0) { printf("571 Multiple recipients not supported.\n"); } @@ -690,10 +675,10 @@ char *argv[]; { - else if (!struncmp(buf, "RCPT", 4)) { + else if (!strncasecmp(buf, "RCPT", 4)) { printf("501 Only 'To:' commands are supported.\n"); } - else if (!struncmp(buf, "DATA", 4)) { + else if (!strncasecmp(buf, "DATA", 4)) { if (strlen(recp) > 0) { printf("354 Sock it to me, baby...\n"); fflush(stdout); @@ -708,7 +693,7 @@ char *argv[]; { printf("500 Huh?\n"); } - } while (struncmp(buf,"QUIT",4)); + } while (strncasecmp(buf,"QUIT",4)); } else { diff --git a/citadel/citserver.c b/citadel/citserver.c index 8b3cdaa50..51ddd9a18 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -167,7 +167,7 @@ void cmd_uchg(char *newusername) { CC->cs_flags &= ~CS_STEALTH; bzero(CC->fake_username, 32); - if (struncmp(newusername, CC->curr_user, strlen(CC->curr_user))) + if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user))) strncpy(CC->fake_username, newusername, 31); } else @@ -195,8 +195,8 @@ int is_public_client(char *where) char buf[256]; FILE *fp; - if (!strucmp(where,"localhost")) return(1); - if (!strucmp(where,config.c_fqdn)) return(1); + if (!strcasecmp(where,"localhost")) return(1); + if (!strcasecmp(where,config.c_fqdn)) return(1); fp = fopen("public_clients","r"); if (fp == NULL) return(0); @@ -204,7 +204,7 @@ int is_public_client(char *where) while (fgets(buf,256,fp)!=NULL) { while (isspace((buf[strlen(buf)-1]))) buf[strlen(buf)-1] = 0; - if (!strucmp(buf,where)) { + if (!strcasecmp(buf,where)) { fclose(fp); return(1); } @@ -658,13 +658,13 @@ void *context_loop(struct CitContext *con) * Let other clients see the last command we executed, but * exclude NOOP because that would be boring. */ - if (struncmp(cmdbuf, "NOOP", 4)) { + if (strncasecmp(cmdbuf, "NOOP", 4)) { strcpy(CC->lastcmdname, " "); strncpy(CC->lastcmdname, cmdbuf, 4); time(&CC->lastidle); } - if ((struncmp(cmdbuf, "ENT0", 4)) && (struncmp(cmdbuf, "MESG", 4)) && (struncmp(cmdbuf, "MSGS", 4))) + if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4))) { CC->cs_flags &= ~CS_POSTING; } @@ -673,340 +673,340 @@ void *context_loop(struct CitContext *con) * This loop recognizes all server commands. */ - if (!struncmp(cmdbuf,"NOOP",4)) { + if (!strncasecmp(cmdbuf,"NOOP",4)) { cprintf("%d%cok\n",OK,check_express()); } - else if (!struncmp(cmdbuf,"QUIT",4)) { + else if (!strncasecmp(cmdbuf,"QUIT",4)) { cprintf("%d Goodbye.\n",OK); } - else if (!struncmp(cmdbuf,"LOUT",4)) { + else if (!strncasecmp(cmdbuf,"LOUT",4)) { if (CC->logged_in) logout(CC); cprintf("%d logged out.\n",OK); } - else if (!struncmp(cmdbuf,"USER",4)) { + else if (!strncasecmp(cmdbuf,"USER",4)) { cmd_user(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"PASS",4)) { + else if (!strncasecmp(cmdbuf,"PASS",4)) { cmd_pass(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"NEWU",4)) { + else if (!strncasecmp(cmdbuf,"NEWU",4)) { cmd_newu(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"SETP",4)) { + else if (!strncasecmp(cmdbuf,"SETP",4)) { cmd_setp(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LRMS",4)) { + else if (!strncasecmp(cmdbuf,"LRMS",4)) { cmd_lrms(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LKRA",4)) { + else if (!strncasecmp(cmdbuf,"LKRA",4)) { cmd_lkra(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LKRN",4)) { + else if (!strncasecmp(cmdbuf,"LKRN",4)) { cmd_lkrn(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LKRO",4)) { + else if (!strncasecmp(cmdbuf,"LKRO",4)) { cmd_lkro(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LZRM",4)) { + else if (!strncasecmp(cmdbuf,"LZRM",4)) { cmd_lzrm(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"GETU",4)) { + else if (!strncasecmp(cmdbuf,"GETU",4)) { cmd_getu(); } - else if (!struncmp(cmdbuf,"SETU",4)) { + else if (!strncasecmp(cmdbuf,"SETU",4)) { cmd_setu(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"GOTO",4)) { + else if (!strncasecmp(cmdbuf,"GOTO",4)) { cmd_goto(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"MSGS",4)) { + else if (!strncasecmp(cmdbuf,"MSGS",4)) { cmd_msgs(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"WHOK",4)) { + else if (!strncasecmp(cmdbuf,"WHOK",4)) { cmd_whok(); } - else if (!struncmp(cmdbuf,"RDIR",4)) { + else if (!strncasecmp(cmdbuf,"RDIR",4)) { cmd_rdir(); } - else if (!struncmp(cmdbuf,"MSG0",4)) { + else if (!strncasecmp(cmdbuf,"MSG0",4)) { cmd_msg0(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"MSG2",4)) { + else if (!strncasecmp(cmdbuf,"MSG2",4)) { cmd_msg2(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"MSG3",4)) { + else if (!strncasecmp(cmdbuf,"MSG3",4)) { cmd_msg3(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"INFO",4)) { + else if (!strncasecmp(cmdbuf,"INFO",4)) { cmd_info(); } - else if (!struncmp(cmdbuf,"SLRP",4)) { + else if (!strncasecmp(cmdbuf,"SLRP",4)) { cmd_slrp(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"INVT",4)) { + else if (!strncasecmp(cmdbuf,"INVT",4)) { cmd_invt_kick(&cmdbuf[5],1); } - else if (!struncmp(cmdbuf,"KICK",4)) { + else if (!strncasecmp(cmdbuf,"KICK",4)) { cmd_invt_kick(&cmdbuf[5],0); } - else if (!struncmp(cmdbuf,"GETR",4)) { + else if (!strncasecmp(cmdbuf,"GETR",4)) { cmd_getr(); } - else if (!struncmp(cmdbuf,"SETR",4)) { + else if (!strncasecmp(cmdbuf,"SETR",4)) { cmd_setr(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"GETA",4)) { + else if (!strncasecmp(cmdbuf,"GETA",4)) { cmd_geta(); } - else if (!struncmp(cmdbuf,"SETA",4)) { + else if (!strncasecmp(cmdbuf,"SETA",4)) { cmd_seta(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"ENT0",4)) { + else if (!strncasecmp(cmdbuf,"ENT0",4)) { cmd_ent0(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"ENT3",4)) { + else if (!strncasecmp(cmdbuf,"ENT3",4)) { cmd_ent3(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"RINF",4)) { + else if (!strncasecmp(cmdbuf,"RINF",4)) { cmd_rinf(); } - else if (!struncmp(cmdbuf,"DELE",4)) { + else if (!strncasecmp(cmdbuf,"DELE",4)) { cmd_dele(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"KILL",4)) { + else if (!strncasecmp(cmdbuf,"KILL",4)) { cmd_kill(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"CRE8",4)) { + else if (!strncasecmp(cmdbuf,"CRE8",4)) { cmd_cre8(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"MOVE",4)) { + else if (!strncasecmp(cmdbuf,"MOVE",4)) { cmd_move(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"FORG",4)) { + else if (!strncasecmp(cmdbuf,"FORG",4)) { cmd_forg(); } - else if (!struncmp(cmdbuf,"MESG",4)) { + else if (!strncasecmp(cmdbuf,"MESG",4)) { cmd_mesg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"EMSG",4)) { + else if (!strncasecmp(cmdbuf,"EMSG",4)) { cmd_emsg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"GNUR",4)) { + else if (!strncasecmp(cmdbuf,"GNUR",4)) { cmd_gnur(); } - else if (!struncmp(cmdbuf,"GREG",4)) { + else if (!strncasecmp(cmdbuf,"GREG",4)) { cmd_greg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"VALI",4)) { + else if (!strncasecmp(cmdbuf,"VALI",4)) { cmd_vali(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"EINF",4)) { + else if (!strncasecmp(cmdbuf,"EINF",4)) { cmd_einf(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LIST",4)) { + else if (!strncasecmp(cmdbuf,"LIST",4)) { cmd_list(); } - else if (!struncmp(cmdbuf,"REGI",4)) { + else if (!strncasecmp(cmdbuf,"REGI",4)) { cmd_regi(); } - else if (!struncmp(cmdbuf,"CHEK",4)) { + else if (!strncasecmp(cmdbuf,"CHEK",4)) { cmd_chek(); } - else if (!struncmp(cmdbuf,"DELF",4)) { + else if (!strncasecmp(cmdbuf,"DELF",4)) { cmd_delf(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"MOVF",4)) { + else if (!strncasecmp(cmdbuf,"MOVF",4)) { cmd_movf(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"NETF",4)) { + else if (!strncasecmp(cmdbuf,"NETF",4)) { cmd_netf(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"RWHO",4)) { + else if (!strncasecmp(cmdbuf,"RWHO",4)) { cmd_rwho(); } - else if (!struncmp(cmdbuf,"OPEN",4)) { + else if (!strncasecmp(cmdbuf,"OPEN",4)) { cmd_open(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"CLOS",4)) { + else if (!strncasecmp(cmdbuf,"CLOS",4)) { cmd_clos(); } - else if (!struncmp(cmdbuf,"UOPN",4)) { + else if (!strncasecmp(cmdbuf,"UOPN",4)) { cmd_uopn(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"UCLS",4)) { + else if (!strncasecmp(cmdbuf,"UCLS",4)) { cmd_ucls(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"READ",4)) { + else if (!strncasecmp(cmdbuf,"READ",4)) { cmd_read(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"WRIT",4)) { + else if (!strncasecmp(cmdbuf,"WRIT",4)) { cmd_writ(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"QUSR",4)) { + else if (!strncasecmp(cmdbuf,"QUSR",4)) { cmd_qusr(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"ECHO",4)) { + else if (!strncasecmp(cmdbuf,"ECHO",4)) { cmd_echo(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"OIMG",4)) { + else if (!strncasecmp(cmdbuf,"OIMG",4)) { cmd_oimg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"MORE",4)) { + else if (!strncasecmp(cmdbuf,"MORE",4)) { cmd_more(); } - else if (!struncmp(cmdbuf,"NETP",4)) { + else if (!strncasecmp(cmdbuf,"NETP",4)) { cmd_netp(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"NDOP",4)) { + else if (!strncasecmp(cmdbuf,"NDOP",4)) { cmd_ndop(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"NUOP",4)) { + else if (!strncasecmp(cmdbuf,"NUOP",4)) { cmd_nuop(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LFLR",4)) { + else if (!strncasecmp(cmdbuf,"LFLR",4)) { cmd_lflr(); } - else if (!struncmp(cmdbuf,"CFLR",4)) { + else if (!strncasecmp(cmdbuf,"CFLR",4)) { cmd_cflr(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"KFLR",4)) { + else if (!strncasecmp(cmdbuf,"KFLR",4)) { cmd_kflr(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"EFLR",4)) { + else if (!strncasecmp(cmdbuf,"EFLR",4)) { cmd_eflr(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"IDEN",4)) { + else if (!strncasecmp(cmdbuf,"IDEN",4)) { cmd_iden(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"IPGM",4)) { + else if (!strncasecmp(cmdbuf,"IPGM",4)) { cmd_ipgm(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"CHAT",4)) { + else if (!strncasecmp(cmdbuf,"CHAT",4)) { cmd_chat(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"PEXP",4)) { + else if (!strncasecmp(cmdbuf,"PEXP",4)) { cmd_pexp(); } - else if (!struncmp(cmdbuf,"SEXP",4)) { + else if (!strncasecmp(cmdbuf,"SEXP",4)) { cmd_sexp(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"EBIO",4)) { + else if (!strncasecmp(cmdbuf,"EBIO",4)) { cmd_ebio(); } - else if (!struncmp(cmdbuf,"RBIO",4)) { + else if (!strncasecmp(cmdbuf,"RBIO",4)) { cmd_rbio(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"LBIO",4)) { + else if (!strncasecmp(cmdbuf,"LBIO",4)) { cmd_lbio(); } - else if (!struncmp(cmdbuf,"STEL",4)) { + else if (!strncasecmp(cmdbuf,"STEL",4)) { cmd_stel(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"TERM",4)) { + else if (!strncasecmp(cmdbuf,"TERM",4)) { cmd_term(&cmdbuf[5]); } - else if (!struncmp(cmdbuf,"DOWN",4)) { + else if (!strncasecmp(cmdbuf,"DOWN",4)) { cmd_down(); } - else if (!struncmp(cmdbuf,"SCDN",4)) { + else if (!strncasecmp(cmdbuf,"SCDN",4)) { cmd_scdn(&cmdbuf[5]); } - else if (!struncmp(cmdbuf, "NSET", 4)) { + else if (!strncasecmp(cmdbuf, "NSET", 4)) { cmd_nset(&cmdbuf[5]); } - else if (!struncmp(cmdbuf, "UIMG", 4)) { + else if (!strncasecmp(cmdbuf, "UIMG", 4)) { cmd_uimg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf, "UCHG", 4)) { + else if (!strncasecmp(cmdbuf, "UCHG", 4)) { cmd_uchg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf, "TIME", 4)) { + else if (!strncasecmp(cmdbuf, "TIME", 4)) { cmd_time(&cmdbuf[5]); } - else if (!struncmp(cmdbuf, "HCHG", 4)) { + else if (!strncasecmp(cmdbuf, "HCHG", 4)) { cmd_hchg(&cmdbuf[5]); } - else if (!struncmp(cmdbuf, "RCHG", 4)) { + else if (!strncasecmp(cmdbuf, "RCHG", 4)) { cmd_rchg(&cmdbuf[5]); } else { @@ -1014,7 +1014,7 @@ void *context_loop(struct CitContext *con) ERROR); } - } while(struncmp(cmdbuf,"QUIT",4)); + } while(strncasecmp(cmdbuf,"QUIT",4)); cleanup(EXIT_NORMAL); return(NULL); diff --git a/citadel/cux2ascii.c b/citadel/cux2ascii.c index ce4bd6a56..010a8f33b 100644 --- a/citadel/cux2ascii.c +++ b/citadel/cux2ascii.c @@ -14,23 +14,9 @@ long finduser(); -void get_config(); struct config config; - -int struncmp(lstr,rstr,len) -char lstr[],rstr[]; -int len; { - int pos = 0; - char lc,rc; - while (posrc) return(1); - pos=pos+1; - } - return(0); - } +void get_config(); +struct config config; + main(argc,argv) int argc; @@ -187,7 +173,7 @@ char *roomname,*newsgroup; { a=strlen(tbuf); while (a--) if (tbuf[a]==',') commapos=a; tbuf[commapos]=0; - if (!strucmp(&tbuf[commapos+1],roomname)) + if (!strcasecmp(&tbuf[commapos+1],roomname)) strcpy(newsgroup,tbuf); } fclose(fp); diff --git a/citadel/file_ops.c b/citadel/file_ops.c index 0168837d0..340915874 100644 --- a/citadel/file_ops.c +++ b/citadel/file_ops.c @@ -100,7 +100,7 @@ void cmd_movf(char *cmdbuf) for (a=0; acurr_rm); } else { @@ -421,17 +421,17 @@ void cmd_uimg(char *cmdbuf) sprintf(CC->upl_path, "./images/%s", basenm); } - if (!strucmp(basenm, "_userpic_")) { + if (!strcasecmp(basenm, "_userpic_")) { sprintf(CC->upl_path, "./userpics/%ld.gif", CC->usersupp.usernum); } - if ( (!strucmp(basenm, "_floorpic_")) && (CC->usersupp.axlevel >= 6) ) { + if ( (!strcasecmp(basenm, "_floorpic_")) && (CC->usersupp.axlevel >= 6) ) { which_floor = extract_int(cmdbuf, 2); sprintf(CC->upl_path, "./images/floor.%d.gif", which_floor); } - if ( (!strucmp(basenm, "_roompic_")) && (is_room_aide()) ) { + if ( (!strcasecmp(basenm, "_roompic_")) && (is_room_aide()) ) { sprintf(CC->upl_path, "./images/room.%d.gif", CC->curr_rm); } @@ -511,13 +511,13 @@ void cmd_ucls(char *cmd) fclose(CC->upload_fp); CC->upload_fp = NULL; - if ((!strucmp(cmd,"1")) && (CC->upload_type != UPL_FILE)) { + if ((!strcasecmp(cmd,"1")) && (CC->upload_type != UPL_FILE)) { CC->upload_type = UPL_FILE; cprintf("%d Upload completed.\n", OK); return; } - if (!strucmp(cmd,"1")) { + if (!strcasecmp(cmd,"1")) { cprintf("%d File '%s' saved.\n",OK,CC->upl_path); fp = fopen(CC->upl_filedir,"a"); if (fp==NULL) fp=fopen(CC->upl_filedir,"w"); @@ -618,7 +618,7 @@ void cmd_netp(char *cmdbuf) char buf[256]; extract(buf,cmdbuf,1); - if (strucmp(buf,config.c_net_password)) { + if (strcasecmp(buf,config.c_net_password)) { cprintf("%d authentication failed\n",ERROR); return; } diff --git a/citadel/internetmail.c b/citadel/internetmail.c index 351f63f11..d0471d664 100644 --- a/citadel/internetmail.c +++ b/citadel/internetmail.c @@ -16,7 +16,6 @@ extern struct config config; -int struncmp(); char metoo[10][128]; int mecount = 0; @@ -64,21 +63,21 @@ void LoadInternetConfig() { StripLeadingAndTrailingWhitespace(ParamName); StripLeadingAndTrailingWhitespace(ParamValue); - if (!strucmp(ParamName, "aliases")) + if (!strcasecmp(ParamName, "aliases")) strcpy(ALIASES, ParamValue); - if (!strucmp(ParamName, "cit86net spoolin")) + if (!strcasecmp(ParamName, "cit86net spoolin")) strcpy(CIT86NET, ParamValue); - if (!strucmp(ParamName, "sendmail")) + if (!strcasecmp(ParamName, "sendmail")) strcpy(SENDMAIL, ParamValue); - if (!strucmp(ParamName, "fallback")) + if (!strcasecmp(ParamName, "fallback")) strcpy(FALLBACK, ParamValue); - if (!strucmp(ParamName, "gateway domain")) + if (!strcasecmp(ParamName, "gateway domain")) strcpy(GW_DOMAIN, ParamValue); - if (!strucmp(ParamName, "table file")) + if (!strcasecmp(ParamName, "table file")) strcpy(TABLEFILE, ParamValue); - if (!strucmp(ParamName, "deliver local")) + if (!strcasecmp(ParamName, "deliver local")) strcpy(metoo[mecount++], ParamValue); - if (!strucmp(ParamName, "run netproc")) + if (!strcasecmp(ParamName, "run netproc")) RUN_NETPROC = atoi(ParamValue); } } @@ -92,11 +91,11 @@ void LoadInternetConfig() { int IsHostLocal(char *WhichHost) { int a; - if (!strucmp(WhichHost, FQDN)) return(1); + if (!strcasecmp(WhichHost, FQDN)) return(1); if (mecount > 0) { for (a=0; arc) return(1); - pos=pos+1; - } - return(0); - } - /* * Consult the mailinglists table to find out where we should send the * mailing list postings to. @@ -69,7 +53,7 @@ char listaddr[]; { while (fgets(buf,128,fp)!=NULL) { buf[strlen(buf)-1]=0; for (a=0; a=0)&&(strucmp(aaa,bbb))); + } while ((a>=0)&&(strcasecmp(aaa,bbb))); a=getstring(fp,aaa); if (!strncmp(aaa,"use ",4)) { strcpy(bbb,&aaa[4]); @@ -142,17 +142,17 @@ void cmd_msgs(char *cmdbuf) mode = MSGS_ALL; strcat(which," "); - if (!struncmp(which,"OLD",3)) mode = MSGS_OLD; - if (!struncmp(which,"NEW",3)) mode = MSGS_NEW; - if (!struncmp(which,"FIRST",5)) { + if (!strncasecmp(which,"OLD",3)) mode = MSGS_OLD; + if (!strncasecmp(which,"NEW",3)) mode = MSGS_NEW; + if (!strncasecmp(which,"FIRST",5)) { mode = MSGS_FIRST; cm_howmany = extract_int(cmdbuf,1); } - if (!struncmp(which,"LAST",4)) { + if (!strncasecmp(which,"LAST",4)) { mode = MSGS_LAST; cm_howmany = extract_int(cmdbuf,1); } - if (!struncmp(which,"GT",2)) { + if (!strncasecmp(which,"GT",2)) { mode = MSGS_GT; cm_gt = extract_long(cmdbuf,1); } @@ -469,7 +469,7 @@ void output_message(char *msgid, int mode, int headers_only) } if (mode == MT_RFC822) { - if (!strucmp(snode, NODENAME)) { + if (!strcasecmp(snode, NODENAME)) { strcpy(snode, FQDN); } cprintf("Message-ID: <%s@%s>\n", mid, snode); @@ -512,10 +512,10 @@ void output_message(char *msgid, int mode, int headers_only) while(och=ch, ch = *mptr++, ch>0) { if (ch == 13) ch = 10; ++len; - if ((ch!=10)||(och!=10)) { + /* if ((ch!=10)||(och!=10)) { */ cprintf("%c", ch); if (ch==10) len = 0; - } + /* } */ if (len>=250) { len = 0; /* cprintf("%c", ch); */ @@ -635,7 +635,7 @@ void loadtroom(void) { /* first try to locate the twit room */ for (a=0; ausersupp.fullname)) { + if (!strcasecmp(buf,CC->usersupp.fullname)) { cprintf("%d Can't send mail to yourself!\n", ERROR+NO_SUCH_USER); return; @@ -1225,7 +1225,7 @@ void cmd_move(char *args) targ_slot = (-1); for (a=0; a #include "citadel.h" -int struncmp(); void LoadInternetConfig(); void get_config(); struct config config; @@ -41,22 +40,6 @@ int ch; { } -int struncmp(lstr,rstr,len) -char lstr[],rstr[]; -int len; { - int pos = 0; - char lc,rc; - while (posrc) return(1); - pos=pos+1; - } - return(0); - } - void fpgetfield(fp,string) FILE *fp; @@ -207,7 +190,7 @@ char *argv[]; { * accept postings from subscribed addresses, we must always use the * room's address as the originating user. */ - if ( (argc == 3) && (!strucmp(argv[2], "mlist")) ) { + if ( (argc == 3) && (!strcasecmp(argv[2], "mlist")) ) { mlist = 1; } @@ -238,9 +221,9 @@ char *argv[]; { * users to receive Internet mail. */ fprintf(rmail,"From "); - if (strucmp(nbuf,NODENAME)) fprintf(rmail,"%s!",nbuf); + if (strcasecmp(nbuf,NODENAME)) fprintf(rmail,"%s!",nbuf); - if (!strucmp(nbuf,NODENAME)) strcpy(nbuf, FQDN); + if (!strcasecmp(nbuf,NODENAME)) strcpy(nbuf, FQDN); if (mlist) { fprintf(rmail,"%s\n", rmname); @@ -248,7 +231,7 @@ char *argv[]; { } else { - if (!strucmp(nbuf, NODENAME)) { /* from this system */ + if (!strcasecmp(nbuf, NODENAME)) { /* from this system */ fprintf(rmail,"%s\n",pbuf); fprintf(rmail,"From: %s@%s (%s)\n", sbuf, FQDN, fstr); diff --git a/citadel/netproc.c b/citadel/netproc.c index 974c44d8d..d06376b48 100644 --- a/citadel/netproc.c +++ b/citadel/netproc.c @@ -111,30 +111,6 @@ struct config config; extern char bbs_home_directory[]; extern int home_specified; -int struncmp(lstr,rstr,len) -char lstr[],rstr[]; -int len; { - int pos = 0; - char lc,rc; - while (posrc) return(1); - pos=pos+1; - } - return(0); - } - -/* redefine strucmp, just in case we're using an old version of citadel.h - * that has it as a separate routine - */ -#ifndef strucmp -#undef strucmp -#endif -#define strucmp(lstr,rstr) struncmp(lstr,rstr,32767) - #ifdef NO_STRERROR /* @@ -254,7 +230,7 @@ void setup_special_nodes() { slocal = NULL; for (stemp=slist; stemp!=NULL; stemp=stemp->next) { - if (!strucmp(stemp->s_name,config.c_nodename)) slocal=stemp; + if (!strcasecmp(stemp->s_name,config.c_nodename)) slocal=stemp; } if (slocal==NULL) { slocal =(struct syslist *)malloc(sizeof(struct syslist)); @@ -270,7 +246,7 @@ void setup_special_nodes() { slocal = NULL; for (stemp=slist; stemp!=NULL; stemp=stemp->next) { - if (!strucmp(stemp->s_name,"internet")) slocal=stemp; + if (!strcasecmp(stemp->s_name,"internet")) slocal=stemp; } if (slocal==NULL) { slocal =(struct syslist *)malloc(sizeof(struct syslist)); @@ -298,7 +274,7 @@ void rewrite_syslist() { time(&now); newfp=fopen("network/mail.sysinfo","w"); for (stemp=slist; stemp!=NULL; stemp=stemp->next) { - if (!strucmp(stemp->s_name,config.c_nodename)) { + if (!strcasecmp(stemp->s_name,config.c_nodename)) { time(&stemp->s_lastcontact); strcpy(stemp->s_type,"bin"); strcpy(stemp->s_humannode,config.c_humannode); @@ -472,11 +448,11 @@ char *k_person,*k_room,*k_system; { struct filterlist *fptr; for (fptr=filter; fptr!=NULL; fptr=fptr->next) if ( - ((!strucmp(fptr->f_person,k_person))||(!strcmp(fptr->f_person,"*"))) + ((!strcasecmp(fptr->f_person,k_person))||(!strcmp(fptr->f_person,"*"))) && - ((!strucmp(fptr->f_room,k_room))||(!strcmp(fptr->f_room,"*"))) + ((!strcasecmp(fptr->f_room,k_room))||(!strcmp(fptr->f_room,"*"))) && - ((!strucmp(fptr->f_system,k_system))||(!strcmp(fptr->f_system,"*"))) + ((!strcasecmp(fptr->f_system,k_system))||(!strcmp(fptr->f_system,"*"))) ) return(1); return(0); @@ -486,15 +462,15 @@ int get_sysinfo_type(name) /* determine routing from sysinfo file */ char name[]; { struct syslist *stemp; GETSN: for (stemp=slist; stemp!=NULL; stemp=stemp->next) { - if (!strucmp(stemp->s_name,name)) { - if (!strucmp(stemp->s_type,"use")) { + if (!strcasecmp(stemp->s_name,name)) { + if (!strcasecmp(stemp->s_type,"use")) { strcpy(name,stemp->s_nexthop); goto GETSN; } - if (!strucmp(stemp->s_type,"bin")) { + if (!strcasecmp(stemp->s_type,"bin")) { return(M_BINARY); } - if (!strucmp(stemp->s_type,"uum")) { + if (!strcasecmp(stemp->s_type,"uum")) { return(M_INTERNET); } } @@ -640,7 +616,7 @@ char *tname; { /* name of temp file containing the whole message */ if (a!='M') { fpgetfield(tfp,buf); if (a=='O') for (b=0; bs_nexthop,minfo.nexthop); time(&slist->s_lastcontact); } - else if ((stemp == NULL) && (!strucmp(minfo.N,minfo.nexthop))) { + else if ((stemp == NULL) && (!strcasecmp(minfo.N,minfo.nexthop))) { /* add neighbor system to map */ printf("Adding neighbor system <%s> to map\n", slist->s_name); sprintf(aaa,"%s/network/systems/%s",bbs_home_directory,minfo.N); @@ -854,7 +830,7 @@ NXMSG: /* Seek to the beginning of the next message */ } /* route the message if necessary */ - if ((strucmp(minfo.D,NODENAME))&&(minfo.D[0]!=0)) { + if ((strcasecmp(minfo.D,NODENAME))&&(minfo.D[0]!=0)) { a = get_sysinfo_type(minfo.D); printf("netproc: routing message to system <%s>\n",minfo.D); fflush(stdout); @@ -880,14 +856,14 @@ NXMSG: /* Seek to the beginning of the next message */ } /* check to see if it's a file transfer */ - else if (!struncmp(minfo.S,"FILE",4)) { + else if (!strncasecmp(minfo.S,"FILE",4)) { proc_file_transfer(tname); } /* otherwise process it as a normal message */ else { - if (!strucmp(minfo.R, "postmaster")) { + if (!strcasecmp(minfo.R, "postmaster")) { strcpy(minfo.R, ""); strcpy(minfo.C, "Aide"); } @@ -1038,7 +1014,7 @@ char *sysname; for (cmptr=cmlist; cmptr!=NULL; cmptr=cmptr->next) { /* make sure we're in the correct room... */ - if (strucmp(curr_rm, cmptr->m_rmname)) { + if (strcasecmp(curr_rm, cmptr->m_rmname)) { sprintf(buf, "GOTO %s", cmptr->m_rmname); serv_puts(buf); serv_gets(buf); @@ -1139,7 +1115,7 @@ char *sysname; { strip_trailing_whitespace(rmptr->rm_name); rmptr->rm_lastsent = atol(lbuf); if (crmlist==NULL) crmlist=rmptr; - else if (!strucmp(rmptr->rm_name,"control")) { + else if (!strcasecmp(rmptr->rm_name,"control")) { /* control has to be first in room list */ rmptr->next = crmlist; crmlist = rmptr; diff --git a/citadel/netsetup.c b/citadel/netsetup.c index e64c9d0cd..87bd96579 100644 --- a/citadel/netsetup.c +++ b/citadel/netsetup.c @@ -28,28 +28,6 @@ struct netnode { void get_config(); struct config config; -/* - * struncmp() - case-insensitive version of strncmp() - * citadel.h will #define a strucmp() based on this - */ -int struncmp(lstr,rstr,len) -char lstr[],rstr[]; -int len; { - int pos = 0; - char lc,rc; - while (posrc) return(1); - pos=pos+1; - } - return(0); - } - - - struct netnode *load_node(nodename) char *nodename; { @@ -299,7 +277,7 @@ char *roomname; { } for (rsptr = nnptr->nn_first; rsptr != NULL; rsptr = rsptr->next) { - if (!strucmp(rsptr->rs_name, roomname)) { + if (!strcasecmp(rsptr->rs_name, roomname)) { foundit = 1; } if (rsptr->rs_lastsent > highest) { @@ -335,7 +313,7 @@ char *roomname; { } if (nnptr->nn_first != NULL) - if (!strucmp(nnptr->nn_first->rs_name, roomname)) { + if (!strcasecmp(nnptr->nn_first->rs_name, roomname)) { rshold = nnptr->nn_first; nnptr->nn_first = nnptr->nn_first->next; free(rshold); @@ -344,7 +322,7 @@ char *roomname; { if (nnptr->nn_first != NULL) for (rsptr = nnptr->nn_first; rsptr->next != NULL; rsptr = rsptr->next) { - if (!strucmp(rsptr->next->rs_name, roomname)) { + if (!strcasecmp(rsptr->next->rs_name, roomname)) { rshold = rsptr->next; rsptr->next = rsptr->next->next; free(rshold); diff --git a/citadel/rcit.c b/citadel/rcit.c index 5308bf3ed..93a91bd91 100644 --- a/citadel/rcit.c +++ b/citadel/rcit.c @@ -54,21 +54,6 @@ void load_roomlist() { fclose(fp); } -int struncmp(lstr,rstr,len) -char lstr[],rstr[]; -int len; { - int pos = 0; - char lc,rc; - while (posrc) return(1); - pos=pos+1; - } - return(0); - } int rnewsxref(room,ngroup) /* xref table */ @@ -95,7 +80,7 @@ GNA: strcpy(aaa,""); strcpy(bbb,""); fclose(fp); return(1); } - if (strucmp(ngroup,aaa)) goto GNA; + if (strcasecmp(ngroup,aaa)) goto GNA; fclose(fp); strcpy(room,bbb); return(0); @@ -119,7 +104,7 @@ char ngroup[]; { if (!rnewsxref(room,tryme)) return; room[sizeof(qbuf.QRname)-1]=0; for (b=0; busersupp,CC->curr_user); for (a=0; ainternal_pgm))&&(!strucmp(bbb,towhere))) { + if (((CC->internal_pgm))&&(!strcasecmp(bbb,towhere))) { usergoto(a,1); return; } /* normal clients have to pass through security */ if ( - (strucmp(bbb,towhere)==0) + (strcasecmp(bbb,towhere)==0) && ((QRscratch.QRflags&QR_INUSE)!=0) && ( ((QRscratch.QRflags&QR_PREFONLY)==0) @@ -614,7 +614,7 @@ void cmd_goto(char *gargs) if ( (QRscratch.QRflags&QR_PASSWORDED) && (CC->usersupp.axlevel<6) && (QRscratch.QRgen!=CC->usersupp.generation[a]) && - (strucmp(QRscratch.QRpasswd,password)) + (strcasecmp(QRscratch.QRpasswd,password)) ) { cprintf("%d wrong or missing passwd\n", ERROR+PASSWORD_REQUIRED); @@ -717,7 +717,7 @@ void cmd_rdir(void) { ls = fopen(CC->temp,"r"); while (fgets(flnm,256,ls)!=NULL) { flnm[strlen(flnm)-1]=0; - if (strucmp(flnm,"filedir")) { + if (strcasecmp(flnm,"filedir")) { sprintf(buf,"%s/files/%s/%s", BBSDIR,CC->quickroom.QRdirname,flnm); stat(buf,&statbuf); @@ -726,7 +726,7 @@ void cmd_rdir(void) { while ((fgets(buf,256,fd)!=NULL) &&(strlen(comment)==0)) { buf[strlen(buf)-1] = 0; - if ((!struncmp(buf,flnm,strlen(flnm))) + if ((!strncasecmp(buf,flnm,strlen(flnm))) && (buf[strlen(flnm)]==' ')) strncpy(comment, &buf[strlen(flnm)+1],255); @@ -1156,7 +1156,7 @@ void cmd_cre8(char *args) for (a=0; a", un, cmdbuf); } - if ((strucmp(cmdbuf,"NOOP")) && (flag !=2)) { + if ((strcasecmp(cmdbuf,"NOOP")) && (flag !=2)) { fp = fopen(CHATLOG,"a"); fprintf(fp,"%s\n",bcast); fclose(fp); @@ -120,7 +120,7 @@ t_context *find_context(char **unstr) else name = t_cc->curr_user; tptr = *unstr; - if ((!struncmp(name, tptr, strlen(name))) && (tptr[strlen(name)] == ' ')) + if ((!strncasecmp(name, tptr, strlen(name))) && (tptr[strlen(name)] == ' ')) { found_cc = t_cc; *unstr = &(tptr[strlen(name)+1]); @@ -143,7 +143,7 @@ void do_chat_listing(int allflag) cprintf(":|\n:| Users currently in chat:\n"); begin_critical_section(S_SESSION_TABLE); for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { - if ( (!strucmp(ccptr->cs_room, "")) + if ( (!strcasecmp(ccptr->cs_room, "")) && ((ccptr->cs_flags & CS_STEALTH) == 0)) { cprintf(":| %-25s <%s>\n", (ccptr->fake_username[0]) ? ccptr->fake_username : ccptr->curr_user, ccptr->chat_room); } @@ -154,7 +154,7 @@ void do_chat_listing(int allflag) cprintf(":|\n:| Users not in chat:\n"); for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { - if ( (strucmp(ccptr->cs_room, "")) + if ( (strcasecmp(ccptr->cs_room, "")) && ((ccptr->cs_flags & CS_STEALTH) == 0)) { cprintf(":| %-25s <%s>:\n", (ccptr->fake_username[0]) ? ccptr->fake_username : ccptr->curr_user, (ccptr->fake_roomname[0]) ? ccptr->fake_roomname : ccptr->cs_room); @@ -212,14 +212,14 @@ void cmd_chat(char *argbuf) time(&CC->lastcmd); time(&CC->lastidle); - if ( (!strucmp(cmdbuf,"exit")) - ||(!strucmp(cmdbuf,"/exit")) - ||(!strucmp(cmdbuf,"quit")) - ||(!strucmp(cmdbuf,"logout")) - ||(!strucmp(cmdbuf,"logoff")) - ||(!strucmp(cmdbuf,"/q")) - ||(!strucmp(cmdbuf,".q")) - ||(!strucmp(cmdbuf,"/quit")) + if ( (!strcasecmp(cmdbuf,"exit")) + ||(!strcasecmp(cmdbuf,"/exit")) + ||(!strcasecmp(cmdbuf,"quit")) + ||(!strcasecmp(cmdbuf,"logout")) + ||(!strcasecmp(cmdbuf,"logoff")) + ||(!strcasecmp(cmdbuf,"/q")) + ||(!strcasecmp(cmdbuf,".q")) + ||(!strcasecmp(cmdbuf,"/quit")) ) strcpy(cmdbuf,"000"); if (!strcmp(cmdbuf,"000")) { @@ -233,10 +233,10 @@ void cmd_chat(char *argbuf) return; } - if ((!strucmp(cmdbuf,"/help")) - ||(!strucmp(cmdbuf,"help")) - ||(!strucmp(cmdbuf,"/?")) - ||(!strucmp(cmdbuf,"?"))) { + if ((!strcasecmp(cmdbuf,"/help")) + ||(!strcasecmp(cmdbuf,"help")) + ||(!strcasecmp(cmdbuf,"/?")) + ||(!strcasecmp(cmdbuf,"?"))) { cprintf(":|\n"); cprintf(":|Available commands: \n"); cprintf(":|/help (prints this message) \n"); @@ -249,27 +249,27 @@ void cmd_chat(char *argbuf) cprintf(":|\n"); ok_cmd = 1; } - if (!strucmp(cmdbuf,"/who")) { + if (!strcasecmp(cmdbuf,"/who")) { do_chat_listing(0); ok_cmd = 1; } - if (!strucmp(cmdbuf,"/whobbs")) { + if (!strcasecmp(cmdbuf,"/whobbs")) { do_chat_listing(1); ok_cmd = 1; } - if (!struncmp(cmdbuf,"/me ",4)) { + if (!strncasecmp(cmdbuf,"/me ",4)) { allwrite(&cmdbuf[4],1, CC->chat_room, NULL); ok_cmd = 1; } - if (!struncmp(cmdbuf,"/msg ", 5)) + if (!strncasecmp(cmdbuf,"/msg ", 5)) { ok_cmd =1; strptr1 = &cmdbuf[5]; if ((t_context = find_context(&strptr1))) { allwrite(strptr1, 2, "", CC->curr_user); - if (strucmp(CC->curr_user, t_context->curr_user)) + if (strcasecmp(CC->curr_user, t_context->curr_user)) allwrite(strptr1, 2, "", t_context->curr_user); } else @@ -277,7 +277,7 @@ void cmd_chat(char *argbuf) cprintf("\n"); } - if (!struncmp(cmdbuf,"/join ", 6)) + if (!strncasecmp(cmdbuf,"/join ", 6)) { ok_cmd = 1; allwrite("",0, CC->chat_room, NULL); @@ -312,9 +312,9 @@ void cmd_chat(char *argbuf) ThisLastMsg = ChatLastMsg; for (clptr=ChatQueue; clptr!=NULL; clptr=clptr->next) { - if ((clptr->chat_seq > MyLastMsg) && ((!clptr->chat_username[0]) || (!struncmp(un, clptr->chat_username, 32)))) + if ((clptr->chat_seq > MyLastMsg) && ((!clptr->chat_username[0]) || (!strncasecmp(un, clptr->chat_username, 32)))) { - if ((!clptr->chat_room[0]) || (!struncmp(CC->chat_room, clptr->chat_room, 20))) + if ((!clptr->chat_room[0]) || (!strncasecmp(CC->chat_room, clptr->chat_room, 20))) { cprintf("%s\n", clptr->chat_text); } @@ -406,7 +406,7 @@ void cmd_sexp(char *argbuf) return; } - if ( (!strucmp(x_user, "broadcast")) && (CC->usersupp.axlevel < 6) ) { + if ( (!strcasecmp(x_user, "broadcast")) && (CC->usersupp.axlevel < 6) ) { cprintf("%d Higher access required to send a broadcast.\n", ERROR+HIGHER_ACCESS_REQUIRED); return; @@ -422,14 +422,14 @@ void cmd_sexp(char *argbuf) else un = ccptr->usersupp.fullname; - if ( (!strucmp(un, x_user)) - || (!strucmp(x_user, "broadcast")) ) { + if ( (!strcasecmp(un, x_user)) + || (!strcasecmp(x_user, "broadcast")) ) { strcpy(ccptr->last_pager, CC->curr_user); emnew = (struct ExpressMessage *) malloc(sizeof(struct ExpressMessage)); emnew->next = NULL; sprintf(emnew->em_text, "%s from %s:\n %s\n", - ( (!strucmp(x_user, "broadcast")) ? "Broadcast message" : "Message" ), + ( (!strcasecmp(x_user, "broadcast")) ? "Broadcast message" : "Message" ), lun, x_msg); if (ccptr->FirstExpressMessage == NULL) { diff --git a/citadel/support.c b/citadel/support.c index 896797617..e9723bf00 100644 --- a/citadel/support.c +++ b/citadel/support.c @@ -7,25 +7,6 @@ #include "server.h" #include "proto.h" -/* - * struncmp() - case-insensitive version of strncmp() - * citadel.h will #define a strucmp() based on this - */ -int struncmp(char *lstr, char *rstr, int len) -{ - int pos = 0; - char lc,rc; - while (posrc) return(1); - pos=pos+1; - } - return(0); - } - /* * strproc() - make a string 'nice' @@ -175,7 +156,7 @@ int pattern2(char *search, char *patn) { int a; for (a=0; ausersupp.fullname, config.c_sysadm)) { + if (!strcasecmp(CC->usersupp.fullname, config.c_sysadm)) { CC->usersupp.axlevel = 6; } @@ -279,7 +279,7 @@ void cmd_pass(char *buf) if (CC->usersupp.USuid == BBSUID) { strproc(password); strproc(CC->usersupp.password); - code = strucmp(CC->usersupp.password,password); + code = strcasecmp(CC->usersupp.password,password); } else { p = (struct passwd *)getpwuid(CC->usersupp.USuid); @@ -458,9 +458,9 @@ void cmd_newu(char *cmdbuf) } a = create_user(username); - if ((!strucmp(username, "bbs")) || - (!strucmp(username, "new")) || - (!strucmp(username, "."))) + if ((!strcasecmp(username, "bbs")) || + (!strcasecmp(username, "new")) || + (!strcasecmp(username, "."))) { cprintf("%d '%s' is an invalid login name.\n", ERROR); return; @@ -565,7 +565,7 @@ void cmd_slrp(char *new_ptr) return; } - if (!struncmp(new_ptr,"highest",7)) { + if (!strncasecmp(new_ptr,"highest",7)) { newlr = CC->quickroom.QRhighest; } else { @@ -743,9 +743,9 @@ void cmd_greg(char *who) return; } - if (!strucmp(who,"_SELF_")) strcpy(who,CC->curr_user); + if (!strcasecmp(who,"_SELF_")) strcpy(who,CC->curr_user); - if ((CC->usersupp.axlevel < 6) && (strucmp(who,CC->curr_user))) { + if ((CC->usersupp.axlevel < 6) && (strcasecmp(who,CC->curr_user))) { cprintf("%d Higher access required.\n", ERROR+HIGHER_ACCESS_REQUIRED); return;