[mw-devel] [Git][arthur/mw][master] The big dangling whitespace cleanup of 2015

Andrew Price welshbyte at sucs.org
Sat Oct 17 12:04:12 BST 2015


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
0513f996 by Andrew Price at 2015-10-17T11:59:46Z
The big dangling whitespace cleanup of 2015

Tip: this can be avoided by adding this to your .vimrc:

match ErrorMsg '\s\+$'

- - - - -


57 changed files:

- src/client/Parse.c
- src/client/add.c
- src/client/alarm.c
- src/client/alarm.h
- src/client/alias.h
- src/client/colour.c
- src/client/edit.c
- src/client/expand.c
- src/client/getpass.c
- src/client/hash.c
- src/client/incoming.c
- src/client/init.c
- src/client/js.c
- src/client/log.c
- src/client/log.h
- src/client/main.c
- src/client/mesg.c
- src/client/mod.c
- src/client/new.c
- src/client/newmain.c
- src/client/read.c
- src/client/script.c
- src/client/script.h
- src/client/script_inst.c
- src/client/sort.h
- src/client/sqlite.c
- src/client/talker.c
- src/client/talker_privs.c
- src/client/uri.c
- src/client/user.c
- src/client/userio.c
- src/folders.c
- src/gags.c
- src/gagtable.c
- src/iconv.c
- src/ipc.c
- src/list.h
- src/perms.c
- src/server/mwserv.c
- src/server/replay.c
- src/server/servsock.c
- src/socket.c
- src/socket.h
- src/special.c
- src/special.h
- src/str_util.c
- src/talker_privs.c
- src/user.c
- src/user.h
- src/utils/clean_users.c
- src/utils/del_user.c
- src/utils/fixuser.c
- src/utils/sizes.c
- src/webclient/comms.c
- src/webclient/import.c
- src/webclient/list.h
- src/webclient/mwpoll.c


Changes:

=====================================
src/client/Parse.c
=====================================
--- a/src/client/Parse.c
+++ b/src/client/Parse.c
@@ -29,7 +29,7 @@ int ParseLine(char *line, const char *argv[])
 	int n=0;
 	int quoted=0;
 	int slashed=0;
-	
+
 	while(n<MAX_ARGC-1)
 	{
 /*		printf("Skip spaces on [%s...]\n",ptr);*/
@@ -93,7 +93,7 @@ char *remove_first_word(char *args)
 {
 	char *ptr, *ptr2;
 
-	ptr = args; 
+	ptr = args;
 	while (ptr && *ptr && isspace(*ptr)) ptr++;
 	if (ptr && *ptr)
 	{
@@ -144,7 +144,7 @@ int DoCommand(char *input, CommandList *cm)
 	al=alias_list;
 	while (al!=NULL)
 	{
-		if (!strcasecmp(al->from,argv[0])) 
+		if (!strcasecmp(al->from,argv[0]))
 		{
 			dowhat=al->to;
 			break;
@@ -181,7 +181,7 @@ int DoCommand(char *input, CommandList *cm)
 						printf("Ambiguous command. Possibilities:-\n");
 						printf("%s, %s",found->Command, cm->Command);
 					}else /* more */
-					printf(", %s",cm->Command);	
+					printf(", %s",cm->Command);
 					count++;
 				}
 			}
@@ -231,7 +231,7 @@ int DoCommand(char *input, CommandList *cm)
 		exact->Function(exact,argc,argv, args);
 		if (args!=NULL) free(args);
 		return 1;
-	}else	
+	}else
 	if (count==1)
 	{
 		if(argc<found->Args+1)
@@ -292,7 +292,7 @@ int command_compare(const char *input, const char *comm)
 	while (tolower(input[c])==tolower(comm[c]) && c<len) c++;
 	return(c);
 }
-	
+
 void help_list(CommandList *c, unsigned int hidestuff)
 {
 	char		buff[10];


=====================================
src/client/add.c
=====================================
--- a/src/client/add.c
+++ b/src/client/add.c
@@ -116,7 +116,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 
 	fol=(struct folder *)malloc(sizeof(*fol));
 	new=(struct Header *)malloc(sizeof(*new));
-	
+
 	if (!get_folder_number(fol,folnum))
 	{
 		free(fol);
@@ -136,15 +136,15 @@ int add_msg(int folnum,struct person *user,int replyto)
 	if (!remote)
 	{
 		if (replyto==0)
-			printf(_("Writing in folder %s.\n"),fol->name);	
+			printf(_("Writing in folder %s.\n"),fol->name);
 		else
 			printf(_("Replying to message %d in folder %s\n"),replyto,fol->name);
 	}
-	
+
 	if (!remote && is_private(fol,user))
 	{
 		printf(_("Note: Operators have the right to read any 'private' messages.\n"));
-		printf(_("    : If you don't like this, don't write private messages.\n"));	
+		printf(_("    : If you don't like this, don't write private messages.\n"));
 	}
 	if (replyto>0)
 	{
@@ -178,15 +178,15 @@ int add_msg(int folnum,struct person *user,int replyto)
 			free(new);
 			return(0);
 		}
-		replyposn=lseek(headfile,0,1)-sizeof(inreplyto);	
+		replyposn=lseek(headfile,0,1)-sizeof(inreplyto);
 		close(headfile);
 		inreplyto.status|=(1<<2);
 	}
-	
-	new->replyto=replyto;	
+
+	new->replyto=replyto;
 	new->status=0;
 	if (remote) new->status|=(1<<3);
-	
+
 	new->date=time(0);
 	if (!remote) printf(_("Message from %s\n"),user->name);
 	strncpy(new->from,user->name,30);
@@ -198,7 +198,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 		strncpy(t,new->to,NAMESIZE);
 		strip_name(t);
 		if (is_private(fol,user) && !is_old(&usr,t,&up))
-		{ 
+		{
 			printf(_("Message must be addressed to an existing user.\n"));
 			free(fol);
 			free(new);
@@ -218,7 +218,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 			printf(_("Send to: "));
 			get_str(new->to,SUBJECTSIZE);
 			if (is_private(fol,user) && !is_old(&usr,new->to,&up))
-			{ 
+			{
 				printf(_("Message must be addressed to an existing user.\n"));
 				free(fol);
 				free(new);
@@ -232,10 +232,10 @@ int add_msg(int folnum,struct person *user,int replyto)
 			strncpy(new->to,inreplyto.from,SUBJECTSIZE);
 			printf(("Marked as To: %s\n"),new->to);
 		}
-	}	
+	}
 	/* read in main message text */
-	
-	clearerr(stdin);	
+
+	clearerr(stdin);
 	buff=(char *)malloc(1024);
 	limit=1024;
 	if (!remote)
@@ -269,7 +269,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 	clearerr(stdin);
 	/* read in current folder status & prepare message for saveing */
 
-	if (!remote)	
+	if (!remote)
 	do{
 		printf(_("Post message, edit, reformat, or Abandon ?"));
 		get_str(answer,9);
@@ -305,7 +305,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 			}else
 				myeditor=SECUREEDITOR;
 
-			if (perms_drop()==-1) 
+			if (perms_drop()==-1)
 			{
 				printf(_("Failed to set user id, aborting.\n"));
 				perror("setuid");
@@ -326,7 +326,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 			mask=umask(~0600);
 			tfile = mkstemp(fullpath);
 			if (tfile < 0)
-			{	
+			{
 				printf(_("Cannot create temporary file: %s\n"), strerror(errno));
 				perms_restore();
 				free(fol);
@@ -354,7 +354,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 			}else
 			{
 				int a;
-			
+
 				do {
 					a=wait(NULL);
 					if (a==-1 && errno!=EINTR)
@@ -384,9 +384,9 @@ int add_msg(int folnum,struct person *user,int replyto)
 
 	folderfile=openfolderfile(O_RDWR);
 	Lock_File(folderfile);
-		
+
 	/* open files ready for saveing */
-	
+
 	if ((i=err_open(buildpath(STATEDIR,fol->name,INDEX_END,is_moderated(fol,user)?MOD_END:""),O_CREAT|O_RDWR,0600))<0)
 	{
 		exit(-1);
@@ -398,7 +398,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 	Lock_File(folderfile);
 	Lock_File(i);
 	Lock_File(data);
-	
+
 	new->datafield=lseek(data,0l,2);
 	lseek(folderfile,folnum*sizeof(struct folder),0);
 	read(folderfile,fol,sizeof(*fol));
@@ -417,10 +417,10 @@ int add_msg(int folnum,struct person *user,int replyto)
 	{
 		new->Ref=0;
 	}
-	
+
 	tt=lseek(i,0,2);
 	td=tt%sizeof(*new);
-	
+
 	if (td>0){
 		printf(_("Warning: Index error, skipping back %ld bytes.\r\n"),td);
 		lseek(i,-td,1);
@@ -451,7 +451,7 @@ int add_msg(int folnum,struct person *user,int replyto)
 	Unlock_File(data);
 	Unlock_File(i);
 	Unlock_File(folderfile);
-	
+
 	close(i);
 	close(data);
 	close(folderfile);


=====================================
src/client/alarm.c
=====================================
--- a/src/client/alarm.c
+++ b/src/client/alarm.c
@@ -50,7 +50,7 @@ void alarm_cleanup(void)
 	s.sa_handler = SIG_DFL;
 	s.sa_flags = 0;
 	s.sa_mask = mask;
-	sigaction(SIGALRM, &s, NULL);	
+	sigaction(SIGALRM, &s, NULL);
 	next_alarm = NULL;
 	while (first_alarm != NULL)
 	{


=====================================
src/client/alarm.h
=====================================
--- a/src/client/alarm.h
+++ b/src/client/alarm.h
@@ -21,7 +21,7 @@ void alarm_cleanup(void);
 void alarm_handler(int sig);
 struct alarm *alarm_at(const struct timeval *when, void *what, void (*how)(void *));
 struct alarm *alarm_after(long secs, long usecs, void *what, void (*how)(void *));
-void alarm_sleep(struct timeval *delay, int resume); 
+void alarm_sleep(struct timeval *delay, int resume);
 int alarm_select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
 
 #endif /* ALARM_H */


=====================================
src/client/alias.h
=====================================
--- a/src/client/alias.h
+++ b/src/client/alias.h
@@ -1,7 +1,7 @@
 #ifndef ALIAS_H
 #define ALIAS_H
 
-typedef struct alias_record 
+typedef struct alias_record
 {
 	char *from;
 	char *to;


=====================================
src/client/colour.c
=====================================
--- a/src/client/colour.c
+++ b/src/client/colour.c
@@ -51,7 +51,7 @@ char *colour(char *text, int *concealed)
 	line[i++]='[';
 
 	/* reset string ? */
-	if (strchr("-n", text[0]) && 
+	if (strchr("-n", text[0]) &&
 	    strchr("-n", text[1]) )
 	{
 		line[i++]='m';
@@ -59,9 +59,9 @@ char *colour(char *text, int *concealed)
 		return(line);
 	}
 
-#ifdef CHILDISH	
+#ifdef CHILDISH
 	/* hidden text ? */
-	if (strchr("Hh", text[0]) && 
+	if (strchr("Hh", text[0]) &&
 	    strchr("Hh", text[1]) )
 	{
 		/* return 'normal' colour code, and set 'concealed' */
@@ -92,7 +92,7 @@ char *colour(char *text, int *concealed)
 		if (strchr("bB",text[0])) line[i++]='4'; else
 		if (strchr("mM",text[0])) line[i++]='5'; else
 		if (strchr("cC",text[0])) line[i++]='6'; else
-		if (strchr("wW",text[0])) line[i++]='7'; 
+		if (strchr("wW",text[0])) line[i++]='7';
 
 		/* seperator */
 		if (strchr("n-",text[0])==NULL && strchr("n-",text[1])==NULL) line[i++]=';';
@@ -156,7 +156,7 @@ void colour_load(char *file, int quiet)
 		if ((c=strtok(buff," \t"))==NULL) { free(buff); continue; }
 		i=atoi(c);
 		if (i<0 || i>=COLOUR_LIMIT) { free(buff); continue; }
-		
+
 		if ((c=strtok(NULL, "\n"))==NULL) { free(buff); continue; }
 
 		while (*c==' ' || *c=='\t') c++;
@@ -164,18 +164,18 @@ void colour_load(char *file, int quiet)
 		if (colour_chart[i]!=NULL)
 			if (!quiet) printf("Warning: redefining colour %d\n",i);
 
-		colour_chart[i]=strdup(c);	
+		colour_chart[i]=strdup(c);
 		count++;
 		free(buff);
 	}
 	if (!quiet) printf("Loaded %d colour definitions.\n",count);
 }
 
-void init_colour(void)	
+void init_colour(void)
 {
 	int i;
 	char path[1024];
-	
+
 	for (i=0;i<COLOUR_LIMIT;i++) colour_chart[i]=NULL;
 
 	snprintf(path, 1023, COLOURDIR"/%d.col", user->colour);


=====================================
src/client/edit.c
=====================================
--- a/src/client/edit.c
+++ b/src/client/edit.c
@@ -46,11 +46,11 @@ extern long userposn;
 static void edit_all(struct person *usr)
 {
 	int i,r;
-	char tmp[80];	
-	
+	char tmp[80];
+
 	printf("Editing user %s\n",usr->name);
 	printf("Enter new data for each field <cr> to leave unchanged.\n");
-	
+
 	printf("realname: %s\nnew name: ",usr->realname);
 	get_str(tmp,REALNAMESIZE);
 	if (strlen(tmp)!=0) strcpy(usr->realname,tmp);
@@ -80,7 +80,7 @@ static void edit_all(struct person *usr)
 	show_user_stats(usr->status,tmp,true);
 	printf("current status %s\nnew status: ",tmp);
 	get_str(tmp,20);
-	if (*tmp) 
+	if (*tmp)
 	{
 		usr->status=user_stats(tmp,usr->status);
 		show_user_stats(usr->status,tmp,false);
@@ -113,7 +113,7 @@ static void show_change(char *old, char *new, const char *fmt, ...)
 			strncat(sub, buff, MAXTEXTLENGTH - strlen(sub) - 1);
 		}
 	}
-	
+
 	/* calulate add */
 	add[0] = 0;
 	for (i=0; i < strlen(new); i++)
@@ -150,7 +150,7 @@ void edit_user(const char *args, const char *name)
 		printf(_("Username %s not found.\n"),name);
 		return;
 	}
-	
+
 	if (stringcmp(args,"edit",-1))
 		edit_all(&usr);
 	else
@@ -222,7 +222,7 @@ void edit_user(const char *args, const char *name)
 		printf(_("New chatprivs [+-=][%s]: "),display_cpflags((unsigned long)0xffffffff));
 		get_str(stats,38);
 		if (*stats)
-		{	
+		{
 			usr.chatprivs=cp_setbycode(usr.chatprivs, stats);
 			printf(_("Chatprivs set to [%s].\n"),display_cpflags(usr.chatprivs));
 			ipc_send_to_username(usr.name, IPC_CHATPRIVS, stats);
@@ -278,7 +278,7 @@ void edit_user(const char *args, const char *name)
 		printf(_("New chatmode [+-=][%s]: "),display_cmflags((unsigned long)0xffffffff));
 		get_str(stats,38);
 		if (*stats)
-		{	
+		{
 			usr.chatmode=cm_setbycode(usr.chatmode, stats);
 			printf(_("Chatmode set to [%s].\n"),display_cmflags(usr.chatmode));
 			ipc_send_to_username(usr.name, IPC_CHATMODE, stats);
@@ -412,12 +412,12 @@ void edit_user(const char *args, const char *name)
 				}else
 					printf(_("Attempting to update existing user.\n"));
 			}
-	
+
 			printf(_("Are you sure you want to change user '%s' into user '%s' ? "),oldname,username);
 			fflush(stdout);
 			get_str(answer,5);
 			if (answer[0]=='y' || answer[0]=='Y')
-			{	
+			{
 				strcpy(usr.name,username);
 				ipc_send_to_username(oldname, IPC_USERNAME, usr.name);
 				printf(_("New name set.\n"));
@@ -552,7 +552,7 @@ void edit_user(const char *args, const char *name)
 		show_special(usr.special,specs,true);
 		printf(_("Username: %s\nReal Name: %s\n"),usr.name,usr.realname);
 		printf(_("Contact: %s\nStatus [%s]\tSpecials [%s]\n"),usr.contact,stats,specs);
-		
+
 		show_fold_groups(usr.groups,stats,true);
 		printf(_("Groups [%s]\n"),stats);
 
@@ -587,7 +587,7 @@ static void users_lastread(int folnum)
 {
 	struct person usr;
 	int ufile;
-	
+
 	ufile=userdb_open(O_RDWR);
 	Lock_File(ufile);
 	while (read(ufile,&usr,sizeof(usr))>0)
@@ -607,8 +607,8 @@ void edit_folder(const char *args, const char *name)
 	int folnum;
 	int afile;
 	struct folder fold;
-	char tmp[80]; 
-	
+	char tmp[80];
+
 	if ((folnum=foldernumber(name))==-1)
 	{
 		printf(_("Unknown folder name.\n"));
@@ -668,7 +668,7 @@ void edit_folder(const char *args, const char *name)
 		get_str(tmp,FOLNAMESIZE);
 		if (*tmp)
 		{
-			char oldpath[PATHSIZE];	
+			char oldpath[PATHSIZE];
 			mwlog("FOLDER(RENAME) of %s to %s", fold.name, tmp);
 
 			sprintf(oldpath,"%s/%s%s",STATEDIR,fold.name,INDEX_END);
@@ -681,12 +681,12 @@ void edit_folder(const char *args, const char *name)
 			{
 			sprintf(oldpath,"%s/%s%s%s",STATEDIR,fold.name,INDEX_END,MOD_END);
 			sprintf(fullpath,"%s/%s%s%s",STATEDIR,tmp,INDEX_END,MOD_END);
-			if (!access(oldpath,00)) rename(oldpath,fullpath); 
+			if (!access(oldpath,00)) rename(oldpath,fullpath);
 			sprintf(oldpath,"%s/%s%s%s",STATEDIR,fold.name,TEXT_END,MOD_END);
 			sprintf(fullpath,"%s/%s%s%s",STATEDIR,tmp,TEXT_END,MOD_END);
 			if (!access(oldpath,00)) rename(oldpath,fullpath);
 			}
-		
+
 			strcpy(fold.name,tmp);
 			printf(_("Name changed to %s\n"),fold.name);
 		}
@@ -771,8 +771,8 @@ void edit_folder(const char *args, const char *name)
 	lseek(afile,folnum*sizeof(struct folder),0);
 	write(afile,&fold,sizeof(struct folder));
 	Unlock_File(afile);
-	close(afile);	
-}	
+	close(afile);
+}
 
 const char *partlist_mesg[]={
 "edit", "to", "subject", "delete", "undelete", "status", NULL};
@@ -782,12 +782,12 @@ void mesg_edit(const char *args, char *foldername, int msgno, struct person *usr
 	int fd, text;
 	struct Header head;
 	char *buff;
-	
+
 	if ((fd=err_open(buildpath(STATEDIR,foldername,INDEX_END,""),O_RDWR,0))<0)
 		return;
 	if ((text=err_open(buildpath(STATEDIR,foldername,TEXT_END,""),O_RDWR,0))<0)
 		return;
-	
+
 	/* go and get message */
 	while (get_data(fd,&head) && head.Ref<msgno);
 	if (head.Ref!=msgno)
@@ -797,7 +797,7 @@ void mesg_edit(const char *args, char *foldername, int msgno, struct person *usr
 	}
 	buff=(char *)malloc(head.size);
 	lseek(text,head.datafield,0);
-	read(text,buff,head.size);	
+	read(text,buff,head.size);
 
 	if (!u_god(usr->status)	&& !u_mod(usr->status) && strcasecmp(head.from,usr->name))
 	{
@@ -813,7 +813,7 @@ void mesg_edit(const char *args, char *foldername, int msgno, struct person *usr
 		int child;
 		const char *myeditor;
 
-		if (perms_drop()==-1) 
+		if (perms_drop()==-1)
 		{
 			printf(_("Failed to set user id, aborting.\n"));
 			perror("setuid");
@@ -852,7 +852,7 @@ void mesg_edit(const char *args, char *foldername, int msgno, struct person *usr
 		}else
 		{
 			int a;
-		
+
 			do {
 				if (mesg_waiting) handle_mesg();
 				a=wait(NULL);
@@ -942,7 +942,7 @@ void mesg_edit(const char *args, char *foldername, int msgno, struct person *usr
 	close(fd);
 	close(text);
 	free(buff);
-}			
+}
 
 void time_on(long u)
 {


=====================================
src/client/expand.c
=====================================
--- a/src/client/expand.c
+++ b/src/client/expand.c
@@ -399,7 +399,7 @@ static const char *expand_index(const char *in, var_list_t *array)
     char *name_start;
     var_op_t saved_op;
     char *saved_key;
-    
+
     SHOWSTATE();
     /*printf("Entering expand_index()\n");*/
     /* Recursively expand the quoted name */
@@ -698,7 +698,7 @@ static const char *eval_expr(const char *in)
 	case '(':
 	    if (push_paren()) break; else return NULL;
 	case ')':
-	    if (push_op(op_paren)) 
+	    if (push_op(op_paren))
 	    {
 	        /*printf("Remaining input: \"%s\"\n", in);*/
 		break;


=====================================
src/client/getpass.c
=====================================
--- a/src/client/getpass.c
+++ b/src/client/getpass.c
@@ -16,7 +16,7 @@ char *get_pass(char *p)
 	int pos=0;
 	printf("%s",p);
 	fflush(stdout);
-	echo_off(); 
+	echo_off();
 	while(1)
 	{
 		int c;
@@ -34,7 +34,7 @@ char *get_pass(char *p)
 		else if(c==10 || c==13)
 		{
 			buf[pos]=0;
-			echo_on(); 
+			echo_on();
 			if(internet==0)
 			{
 				printf("\r\n");


=====================================
src/client/hash.c
=====================================
--- a/src/client/hash.c
+++ b/src/client/hash.c
@@ -68,7 +68,7 @@ void hash_free(int field)
 
     /* Make sure all variables are removed */
     hash_purge(field);
-    
+
     frec = &fields[field];
     /* Relink into free list */
     frec->gnext = freefields;


=====================================
src/client/incoming.c
=====================================
--- a/src/client/incoming.c
+++ b/src/client/incoming.c
@@ -117,7 +117,7 @@ static void StackEvent(char *text, char *from, int flags)
 
 void ClearStack(void) {
 	struct mstack *old;
-	
+
 	/* Nuke the entire stack */
 	while (MesgStack!=NULL) {
 		old=MesgStack;
@@ -464,7 +464,7 @@ static void force_lastread(const char * newbuff) {
 	sscanf(newbuff,"%d:%d",&fol,&pos);
 	user->lastread[fol]=pos;
 }
-			
+
 static void display_uptime(ipc_message_t *msg)
 {
 	json_t * j = json_init(msg);
@@ -542,7 +542,7 @@ static void display_content(ipc_message_t *msg)
 		} else
 		if (strcmp(type, "raw")==0) {
 			snprintf(tb, len, "%s", text);
-		} else 
+		} else
 		if (strcmp(type, "emote")==0) {
 			int plural = json_getint(j, "plural");
 			switch (plural) {
@@ -600,7 +600,7 @@ static void display_content(ipc_message_t *msg)
 			len -= s;
 			tb += s;
 		}
-	
+
 		if (strcmp(type, "whispers")==0) {
 			snprintf(tb, len, "%s whispers: %s", whom, text);
 		} else
@@ -631,7 +631,7 @@ static void display_content(ipc_message_t *msg)
 			len -= s;
 			tb += s;
 		}
-	
+
 		snprintf(tb, len, "%s shouts: %s", whom, text);
 		force_text(msg, buff, whom);
 	} else
@@ -759,7 +759,7 @@ static void accept_pipe_cmd(ipc_message_t *msg, struct person *mesg_user)
 	}
 
 	ipcmsg_destroy(msg);
-	update_user(user,userposn);	
+	update_user(user,userposn);
 }
 
 static void force_newmail(void)
@@ -774,13 +774,13 @@ static void force_text(ipc_message_t *msg, const char *text, const char *from)
 
 	mesg = malloc(sizeof(*mesg));
 	mesg->flags = MST_EVENT|MST_BEEP;
-	
+
 	tb[0]=0;
 	if (s_timestamp(user->special))
 	{
 		time_t t;
 		struct tm *tt;
- 
+
 		t= msg->head.when;
 		tt=localtime(&t);
 		strftime(tb, MAXTEXTLENGTH,"%H:%M ", tt);
@@ -907,7 +907,7 @@ static void force_gag(char *newbuff, unsigned long theirprivs, const char *from)
 
 
 	unsigned long newcm = user->chatmode & ~CM_GAGMASK;
-	if (newbuff[0]=='+') 
+	if (newbuff[0]=='+')
 		newcm |= atoi(&newbuff[1]) << CM_GAGSHIFT;
 
 	user->chatmode=chatmode_describe(user->chatmode, newcm, ourapl, theirapl, from);
@@ -1024,7 +1024,7 @@ static void force_kick(char *newbuff, char *from, unsigned long theirprivs)
 {
 	char	*msg = NULL;
 	char	type;
-	
+
 	type = *newbuff;
 	if (newbuff[1] == 'r') msg = &newbuff[2];
 
@@ -1088,7 +1088,7 @@ static void mrod(char *from, char *msg)
 	printf(_("Boing, Zebedee's left you standing all alone\n"));
 	printf(_("WWWHHHEEEEEEEKKKKEEEERRRRRUUUUUNNNNNCCCCCHHHHHH\7\7\7\7\7\n"));
 	printf(_("%s has just dropped the Magic Roundabout of Death on you.\n"),from);
-	if (msg!=NULL) 
+	if (msg!=NULL)
 	{
 		snprintf(mrod_message, MAXTEXTLENGTH-1, _("\"%s\033--\" says Zebedee\n"), msg);
 		display_message(mrod_message, 1, 1);
@@ -1096,7 +1096,7 @@ static void mrod(char *from, char *msg)
 	fflush(stdout);
 
 	fix_terminal();
-	
+
 	mrod_user = malloc(sizeof(char) * (strlen(from) + 1));
 	strcpy(mrod_user, from);
 	close_down(3, from, msg);


=====================================
src/client/init.c
=====================================
--- a/src/client/init.c
+++ b/src/client/init.c
@@ -54,7 +54,7 @@ void perms_restore(void)
 
 static int ReadInitFile(const char *base, const char *filename)
 {
-	FILE *file;	
+	FILE *file;
 	char *buff, *backup, *header;
 	char path[1024];
 	char *a, *b, *c;
@@ -123,7 +123,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		return 0; // changed because if an error occured after this point the file exists, the js code has reported the error to the user and returning 1 will report to them that it doesn't exist
 	}
 
-	lineno=0;	
+	lineno=0;
 	while (!feof(file))
 	{
 		if ((buff = frl_line_nspace(file, "#")) == NULL) break;
@@ -139,7 +139,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		/* load command aliases */
 		if (!strcasecmp(a,"alias"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed alias in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -162,7 +162,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		/* load function binds */
 		if (!strcasecmp(a,"bind"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed bind in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -185,7 +185,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		/* load rpc binds */
 		if (!strcasecmp(a,"rpc"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed rpc bind in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -208,7 +208,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		/* include a seperate script file */
 		if (!strcasecmp(a, "include"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed include in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -227,7 +227,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		/* check for destroying functions */
 		if (!strcasecmp(a, "destroy"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed include in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -255,7 +255,7 @@ static int ReadInitFile(const char *base, const char *filename)
 		/* bind ipc function */
 		if (!strcasecmp(a, "ipc"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed ipc in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -315,11 +315,11 @@ static int ReadInitFile(const char *base, const char *filename)
 			{
 				printf(_("Force bind already exists. Useless instruction at line %d in %s.\n"), lineno, filename);
 			}
-		}else	
+		}else
 		/* load mw-script functions */
 		if (!strcasecmp(a,"function"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed Script Function declaration in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -328,11 +328,11 @@ static int ReadInitFile(const char *base, const char *filename)
 			}
 			/* set function to 'normal' */
 			LoadFunction(b, header, file, &lineno, filename, 0);
-		}else	
+		}else
 		/* load mw-script functions (local, hidden function) */
 		if (!strcasecmp(a,"lfunction"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed Script Function declaration in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -341,11 +341,11 @@ static int ReadInitFile(const char *base, const char *filename)
 			}
 			/* set function to 'non-interface' (local) */
 			LoadFunction(b, header, file, &lineno, filename, FUNCFLAG_LOCAL);
-		}else	
+		}else
 		/* load mw-script initialisation function */
 		if (!strcasecmp(a,"initfunc"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed Script Init declaration in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -354,11 +354,11 @@ static int ReadInitFile(const char *base, const char *filename)
 			}
 			/* set function to 'init' */
 			LoadFunction(b, header, file, &lineno, filename, FUNCFLAG_AUTOINIT);
-		}else	
+		}else
 		/* load a local, hidden mw-script initialisation function */
 		if (!strcasecmp(a,"linitfunc"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed Script Init declaration in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -367,11 +367,11 @@ static int ReadInitFile(const char *base, const char *filename)
 			}
 			/* set function to 'init' and 'non-interface'*/
 			LoadFunction(b, header, file, &lineno, filename, FUNCFLAG_AUTOINIT | FUNCFLAG_LOCAL);
-		}else	
+		}else
 		/* load mw-script board initialisation function */
 		if (!strcasecmp(a,"boardfunc"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed Script BoardInit declaration in %s at line %d\n"),filename,lineno);
 				free(backup);
@@ -380,11 +380,11 @@ static int ReadInitFile(const char *base, const char *filename)
 			}
 			/* set function to 'boardinit' */
 			LoadFunction(b, header, file, &lineno, filename, FUNCFLAG_BOARDINIT);
-		}else	
+		}else
 		/* load a local, hidden mw-script board initialisation function */
 		if (!strcasecmp(a,"lboardfunc"))
 		{
-			if ((b=strtok(NULL," \t\n\r"))==NULL) 
+			if ((b=strtok(NULL," \t\n\r"))==NULL)
 			{
 				printf(_("Malformed Script BoardInit declaration in %s at line %d\n"),filename,lineno);
 				free(backup);


=====================================
src/client/js.c
=====================================
--- a/src/client/js.c
+++ b/src/client/js.c
@@ -101,14 +101,14 @@ JSClass js_termsizeclass = {
 
 
 /* prints a warning */
-static void js_warning(JSContext *cx, const char *warning) 
+static void js_warning(JSContext *cx, const char *warning)
 {
 	JSStackFrame *fp = NULL;
 	JSScript *script;
 	const char *filename;
 	int lineno;
 	jsbytecode *pc;
-	
+
 	fp = JS_FrameIterator(cx, &fp); // get the current js stack frame
 	script = JS_GetFrameScript(cx, fp); // get the current script from the stack frame
 	filename = JS_GetScriptFilename(cx, script); // get the file name of the script
@@ -116,7 +116,7 @@ static void js_warning(JSContext *cx, const char *warning)
 	lineno = JS_PCToLineNumber(cx, script, pc); // get the actual line number from the pc
 
 	printf("JS Warning: %s\nFile: %s:%u\n", warning, filename, lineno+1);
-	
+
 }
 
 /* called if a script runs too long */
@@ -148,7 +148,7 @@ static void js_start_timeout(void)
 /* Function for printing to standard out from javascript (helpful for
  * debugging and demonstrates how to call C from js) - also useful for event functions
  */
-static JSBool js_print(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_print(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	unsigned int i;
 	jsval *argv = JS_ARGV(cx, vp);
@@ -156,12 +156,12 @@ static JSBool js_print(JSContext *cx, unsigned int argc, jsval *vp)
 	if (argc < 1) {
 		return JS_TRUE;
 	}
-	
+
 	for (i = 0; i<argc; i++) {
 		if (JSVAL_IS_STRING(argv[i]) || JSVAL_IS_NUMBER(argv[i])) {
 			msg = JS_EncodeString(cx, JS_ValueToString(cx, argv[i]));
 			display_message(msg, 0, 1);
-		} else 
+		} else
 		if (JSVAL_IS_NULL(argv[i])) {
 			display_message("jsval is NULL",0,1);
 		} else
@@ -176,7 +176,7 @@ static JSBool js_print(JSContext *cx, unsigned int argc, jsval *vp)
 }
 
 /* execute a talker command */
-static JSBool js_mwexec(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_mwexec(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER msg = NULL;
@@ -184,7 +184,7 @@ static JSBool js_mwexec(JSContext *cx, unsigned int argc, jsval *vp)
 		JS_ReportError(cx, "exec() expects an argument.");
 		return JS_FALSE;
 	}
-	
+
 	if (JSVAL_IS_STRING(argv[0])) {
 		msg = JS_EncodeString(cx, JS_ValueToString(cx, argv[0]));
 		DoCommand(msg, chattable);
@@ -196,7 +196,7 @@ static JSBool js_mwexec(JSContext *cx, unsigned int argc, jsval *vp)
 
 
 /* say to the talker */
-static JSBool js_say(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_say(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER msg = NULL;
@@ -223,7 +223,7 @@ static JSBool js_say(JSContext *cx, unsigned int argc, jsval *vp)
 }
 
 /* send an rpc/rpb */
-static JSBool js_rpc(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_rpc(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER msg = NULL;
@@ -260,7 +260,7 @@ static JSBool js_rpc(JSContext *cx, unsigned int argc, jsval *vp)
 }
 
 /* send an ipc/ipb */
-static JSBool js_ipc(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_ipc(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER msg = NULL;
@@ -292,16 +292,16 @@ static JSBool js_ipc(JSContext *cx, unsigned int argc, jsval *vp)
 }
 
 /* ask a user for extra input */
-static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	JSString *the_jsstring, *jsstr;
 	size_t ucs2_length, prompt_length, line_length;
 	const jschar *ucs2_string;
 	int conv_error;
-	
+
 	char *prompt=NULL, *line;
-	
+
 	if(argc > 0) {
 		if(JSVAL_IS_STRING(argv[0])) {
 			// convert prompt to local - this bit of ugliness is still needed in case people aren't using utf8
@@ -309,7 +309,7 @@ static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp)
 			ucs2_length=JS_GetStringLength(the_jsstring);
 			ucs2_string=JS_GetStringCharsZ(cx, the_jsstring);
 			prompt_length=sizeof(char)*((ucs2_length*3)+1); // bit ugly
-			prompt=malloc(prompt_length); 
+			prompt=malloc(prompt_length);
 			if(prompt!=NULL) {
 				conv_error=convert_string_charset((char *)ucs2_string, "UCS-2", ucs2_length*sizeof(jschar), prompt, "LOCAL//TRANSLIT", prompt_length, NULL, NULL, NULL, NULL, NULL);
 				if(conv_error<0) {
@@ -334,14 +334,14 @@ static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp)
 	busy--;
 
 	free(prompt);
-	
+
 	line_length = sizeof(jschar) * (strlen(line) + 1);
-	
+
 	// likewise as this has come straight from a readline we need a convert from local charset
 	jschar *u2_string = malloc(line_length);
 	if(u2_string!=NULL) {
 		conv_error=convert_string_charset(line, "LOCAL", strlen(line),
-		         (char *)u2_string, "UTF-16//TRANSLIT", line_length, 
+		         (char *)u2_string, "UTF-16//TRANSLIT", line_length,
 		          NULL, NULL, NULL, NULL, NULL);
 		if(conv_error>=0) {
 			jsstr = JS_NewUCStringCopyZ(cx, u2_string);
@@ -379,12 +379,12 @@ static JSBool js_beep(JSContext *cx, unsigned int argc, jsval *vp)
 	{
 		write(1,"\7",1);
 	}
-	
+
 	return JS_TRUE;
 }
 
 /* bind something to a javascript function */
-static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER jbind = NULL;
@@ -392,14 +392,14 @@ static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp)
 	int bind_type=-1;
 	int i=1;
 	char msg[MAXTEXTLENGTH];
-	
+
 	msg[MAXTEXTLENGTH-1]='\0';
-	
+
 	if (argc < 2) {
 		JS_ReportError(cx, "Error in javascript: bind expects at least 2 arguments");
 		return JS_FALSE;
 	}
-		
+
 	if (JSVAL_IS_STRING(argv[0])) {
 		jbind = JS_EncodeString(cx, JS_ValueToString(cx, argv[0]));
 		bind_type=K_BIND;
@@ -492,7 +492,7 @@ static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp)
 				snprintf(msg, MAXTEXTLENGTH-1, "Shutdown bind %s already exists", function_name);
 				js_warning(cx, msg);
 			}
-			
+
 			break;
 		case K_BIND_INPUT:
 			if(AddLink(&eventin_list, function_name, ""))
@@ -510,21 +510,21 @@ static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp)
 }
 
 /* bind something to a javascript function */
-static JSBool js_unbind(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_unbind(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER jbind = NULL;
 	char *function_name=NULL;
 	int bind_type=-1;
 	char msg[MAXTEXTLENGTH];
-	
+
 	msg[MAXTEXTLENGTH-1]='\0';
-	
+
 	if (argc < 1) {
 		JS_ReportError(cx, "Error in javascript: unbind expects at least 1 argument");
 		return JS_FALSE;
 	}
-		
+
 	if (JSVAL_IS_STRING(argv[0])) {
 		jbind = JS_EncodeString(cx, JS_ValueToString(cx, argv[0]));
 		bind_type=K_BIND;
@@ -613,7 +613,7 @@ static JSBool js_unbind(JSContext *cx, unsigned int argc, jsval *vp)
 				snprintf(msg, MAXTEXTLENGTH-1, "Shutdown bind %s does not exist for unbinding", function_name);
 				js_warning(cx, msg);
 			}
-			
+
 			break;
 		case K_BIND_INPUT:
 			if(!DestroyLink(&eventin_list, function_name))
@@ -631,11 +631,11 @@ static JSBool js_unbind(JSContext *cx, unsigned int argc, jsval *vp)
 }
 
 // return the users terminal dimensions
-static JSBool js_termsize(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_termsize(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	JSObject *result_object;
 	int width, height;
-	
+
 	result_object=JS_NewObject(cx, &js_termsizeclass, NULL, NULL);
 	if(result_object==NULL)
 	{
@@ -770,20 +770,20 @@ size_t headlimit(  void  *ptr,  size_t  size, size_t nmemb, void *stream)
 
 /* Function to make a url GET request and return the resulting page
  */
-static JSBool js_urlget(JSContext *cx, unsigned int argc, jsval *vp) 
+static JSBool js_urlget(JSContext *cx, unsigned int argc, jsval *vp)
 {
 	jsval *argv = JS_ARGV(cx, vp);
 	AUTOFREE_BUFFER url = NULL;
 	JSString *jsstr;
 	char msg[MAXTEXTLENGTH];
-	
+
 	msg[MAXTEXTLENGTH-1]='\0';
 
 	if (argc < 1) {
 		JS_ReportError(cx, "Bad Call to js_urlget\n");
 		return JS_FALSE;
 	}
-	
+
 	if (JSVAL_IS_STRING(argv[0])) {
 		CURL *cl;
 		char cerr[CURL_ERROR_SIZE];
@@ -812,9 +812,9 @@ static JSBool js_urlget(JSContext *cx, unsigned int argc, jsval *vp)
 		return JS_TRUE;
 
 
-	} 
+	}
 	JS_ReportError(cx, "urlget requires a string.");
-	
+
 	return JS_FALSE;
 }
 
@@ -823,10 +823,10 @@ static JSObject *dbdata_to_jsarray(JSContext *cx, struct db_data *data, int ncol
 	JSObject *jsdata;
 	JSString *jsstr;
 	jsval jv;
-	int i; 
+	int i;
 //	int conv_error;
 //	size_t data_length;
-	
+
 	if (data == NULL || ncols < 1) return NULL;
 
 	jsdata = JS_NewArrayObject(cx, 0, NULL);
@@ -885,21 +885,21 @@ static JSObject *dbresult_to_jsarray(JSContext *cx, struct db_result *data) {
 static JSObject *dbresult_to_jscolnames(JSContext *cx, struct db_result *data) {
 	JSObject *jsarray;
 	jsval jv;
-	int i; 
+	int i;
 	JSString *jsstr;
 
 	if (data == NULL) return NULL;
 
 	jsarray = JS_NewArrayObject(cx, 0, NULL);
 	JS_AddObjectRoot(cx, &jsarray);
-	
+
 	for(i=0;i<data->cols;i++) {
 		jsstr = JS_NewStringCopyZ(cx, data->colNames[i]);
 		jv = STRING_TO_JSVAL(jsstr);
 		JS_SetElement(cx, jsarray, i, &jv);
-		
+
 	}
-	
+
 	JS_RemoveObjectRoot(cx, &jsarray);
 
 	return jsarray;
@@ -913,17 +913,17 @@ static JSBool dbresult_to_jsdbobject(JSContext *cx, struct js_db_result *data, j
 	JSObject *result_object;
 	JSObject *jsarray, *jscolumns;
 	jsval jsarray_val, jscolumns_val;
-	
+
 	result_object=JS_NewObject(cx, &js_dbresultclass, NULL, NULL);
 	if(result_object==NULL) {
 		return JS_FALSE;
 	}
 	*db_object=OBJECT_TO_JSVAL(result_object);
-	
+
 	JS_DefineProperty(cx, result_object, "db_error", INT_TO_JSVAL(data->db_error), NULL, NULL, JSPROP_READONLY);
 	JS_DefineProperty(cx, result_object, "query_error", INT_TO_JSVAL(data->query_error), NULL, NULL, JSPROP_READONLY);
 	if(data->error_text!=NULL) {
-		
+
 		JS_DefineProperty(cx, result_object, "error_text", STRING_TO_JSVAL(JS_NewStringCopyZ(cx, data->error_text)), NULL, NULL, JSPROP_READONLY);
 	} else {
 		JS_DefineProperty(cx, result_object, "error_text", STRING_TO_JSVAL(JS_NewStringCopyZ(cx, "No Error")), NULL, NULL, JSPROP_READONLY);
@@ -935,11 +935,11 @@ static JSBool dbresult_to_jsdbobject(JSContext *cx, struct js_db_result *data, j
 		jscolumns=dbresult_to_jscolnames(cx, data->query_result);
 		jscolumns_val=OBJECT_TO_JSVAL(jscolumns);
 		JS_DefineProperty(cx, result_object, "column_names", jscolumns_val, NULL, NULL, 0);
-		
+
 	} else {
 		JS_DefineProperty(cx, result_object, "data", JSVAL_NULL, NULL, NULL, 0);
 		JS_DefineProperty(cx, result_object, "column_names", JSVAL_NULL, NULL, NULL, 0);
-	}	
+	}
 	return JS_TRUE;
 }
 
@@ -1080,7 +1080,7 @@ int js_exec(char *name, int argc, const char **argvc) {
 			fprintf(stderr, "js_exec: argc %d was NULL!\n",i);
 			continue;
 		}
-		argv[i] = STRING_TO_JSVAL(JS_NewStringCopyZ(jscx, argvc[i]));	
+		argv[i] = STRING_TO_JSVAL(JS_NewStringCopyZ(jscx, argvc[i]));
 	}
 	js_interrupted=0;
 	js_start_timeout();
@@ -1099,20 +1099,20 @@ int js_exec(char *name, int argc, const char **argvc) {
 
 /* Prints error reports to stdout when a javascript error occurs */
 /* Taken from the spidermonkey tutorial at Kicken's World */
-static void 
+static void
 js_error_handler(JSContext __attribute__((unused)) *cx, const char *msg, JSErrorReport *er)
 {
 	char *pointer=NULL;
 	char *line=NULL;
 	int len;
-	
-	
+
+
 	if (er->linebuf != NULL) {
 		len = er->tokenptr - er->linebuf + 1;
 		if(len<2) len=2;
 		pointer = malloc(len); memset(pointer,
-			'-', len); pointer[len-1]='\0'; 
-		pointer[len-2]='^'; 
+			'-', len); pointer[len-1]='\0';
+		pointer[len-2]='^';
 		len = strlen(er->linebuf)+1;
 		line = malloc(len);
 		strncpy(line, er->linebuf, len);
@@ -1129,9 +1129,9 @@ js_error_handler(JSContext __attribute__((unused)) *cx, const char *msg, JSError
 		line[len-1]='\0';
 		len--;
 	}
-	
+
 	printf("JS Error: %s\nFile: %s:%u\n", msg, er->filename, er->lineno+1);
-	
+
 	if (line[0]) {
 		printf("%s\n%s\n", line, pointer);
 	}
@@ -1158,7 +1158,7 @@ int load_jsfile(FILE *f, const char *filename)
 		printf("Failed to compile js script: %s\n", filename);
 		return 1;
 	}
-	
+
 	/* Execute the compiled script */
 	js_interrupted=0;
 	js_start_timeout();
@@ -1192,7 +1192,7 @@ int is_js(char *name)
 
 static JSBool js_operation_callback(JSContext *cx) {
 	JSObject *global = JS_GetGlobalObject(cx);
-	
+
 	if (global) {
 		if (js_interrupted==1) {
 			JS_ReportError(cx,"Script execution interupted");
@@ -1229,7 +1229,7 @@ int stop_js(void)
 	JS_DestroyContext(jscx);
 	JS_DestroyRuntime(jsrt);
 	return 0;
-	
+
 }
 
 // starts the javascript engine.
@@ -1268,7 +1268,7 @@ int setup_js(void)
 
 	/* initiate builtin classes */
 	JS_InitStandardClasses(jscx, jsroot);
-	
+
 	/* create a callback function that is run when javascript branches backwards */
 	/* allows us to interupt looping scripts */
 #ifdef JS_OPERATION_WEIGHT_BASE
@@ -1309,7 +1309,7 @@ int setup_js(void)
 
 	// Broadcast constant (for ipc,rpc)
 	JS_DefineProperty(jscx, jsroot, "K_BROADCAST", INT_TO_JSVAL(K_BROADCAST), NULL, NULL, JSPROP_READONLY|JSPROP_PERMANENT);
-	
+
 	/* A stateful object backed with persistent db storage */
 	JS_DefineObject(jscx, jsroot, "Store", &js_storeclass, NULL, JSPROP_READONLY|JSPROP_PERMANENT);
 
@@ -1317,8 +1317,8 @@ int setup_js(void)
 	if (is_local) {
 		JS_DefineFunction(jscx, jsroot, "dbquery", js_doquery, 2, 1);
 	}
-	
-	/* need additional functions : 
+
+	/* need additional functions :
 	 * - one to load another script (include?) - possibly although most scripts are loaded from the .mwrc or using .load
 	 * - get system date/time - no, 'new Date()' will get this information for you in a Date object.
 	 */


=====================================
src/client/log.c
=====================================
--- a/src/client/log.c
+++ b/src/client/log.c
@@ -35,7 +35,7 @@ struct uripatt {
 struct uripatt urilist[] = {
 	{"^http://$", 		REG_ICASE, NULL, IGNORE, 0},
 	{"^https://$", 		REG_ICASE, NULL, IGNORE, 0},
-	{"^sucs.org$",  	REG_ICASE, NULL, IGNORE, 0}, /* Ignore the SUCS homepage, "sucs.org" rarely refers to the website and we can presume people know it */  
+	{"^sucs.org$",  	REG_ICASE, NULL, IGNORE, 0}, /* Ignore the SUCS homepage, "sucs.org" rarely refers to the website and we can presume people know it */
 	{"^http://", 		REG_ICASE, NULL, URL,    0},
 	{"^https://", 		REG_ICASE, NULL, URL,    0},
 	{"^www\\.", 		REG_ICASE, NULL, URL,    0},
@@ -117,7 +117,7 @@ void catchuri(const char *what)
 							foundurl[nfoundurl++] = token;
 						}
 					}
-				} 
+				}
 				if (u->type == FLAG) {
 					/* printf("Found flag: '%s' -> %x\n", token, u->flags); */
 					flags |= u->flags;
@@ -137,7 +137,7 @@ void catchuri(const char *what)
 	}
 
 	/*
-	 * we found urls, so launch background threads to 
+	 * we found urls, so launch background threads to
 	 * categorise and file the details
 	 * cant do it in foreground, would stall the ui
 	 */
@@ -195,7 +195,7 @@ static char * cleanup_url(const char *in)
 	if (strchr(p, '/')==NULL) {
 		strcat(out, "/");
 	}
-	return out;	
+	return out;
 }
 
 static char *md5(const char *in)
@@ -227,7 +227,7 @@ static char * extract_title(const char *body)
 }
 
 
-static void *file_url(void * data) 
+static void *file_url(void * data)
 {
 	struct urihit *uri = data;
 	char path[1024];
@@ -244,9 +244,9 @@ static void *file_url(void * data)
 	c = curl_easy_init();
 
 	/* set max download sizes */
-	block_limit(deli, 8192); 
-	block_limit(body, 8192); 
-	block_limit(head, 4096); 
+	block_limit(deli, 8192);
+	block_limit(body, 8192);
+	block_limit(head, 4096);
 
 	/* lets go fishing on del.icio.us */
 	url = cleanup_url(uri->url);
@@ -292,9 +292,9 @@ static void *file_url(void * data)
 	block_free(head);
 
 	/* fishing mission complete, store the results */
-	
+
 	uri_make_flags_str(uri->flags, flags, sizeof(flags));
-	
+
 	char *query = sqlite3_mprintf("INSERT INTO mwuri (user, url, added, flags, title, tags) values (%Q,%Q,datetime('now'),%Q,%Q,%Q)", user->name, url, flags, title, deli==NULL?NULL:deli->p_buffer);
 	res = db_query(MWURI_DB, query, 1);
 	if (res == NULL) {
@@ -315,7 +315,7 @@ static void *file_url(void * data)
 	return NULL;
 }
 
-static void *file_tag(void * data) 
+static void *file_tag(void * data)
 {
 	struct taghit *tag = data;
 	struct db_result *res;


=====================================
src/client/log.h
=====================================
--- a/src/client/log.h
+++ b/src/client/log.h
@@ -11,7 +11,7 @@ struct block_t {
 
 	int     i_used;		/* current fill level */
 	char *p_cursor;		/* user pointer */
-};      
+};
 
 struct block_t * block_new(int);
 void block_free(struct block_t *);


=====================================
src/client/main.c
=====================================
--- a/src/client/main.c
+++ b/src/client/main.c
@@ -138,7 +138,7 @@ static void set_prompt(void)
 {
 	char pre[20];
 
-	if (UseRL) 
+	if (UseRL)
 		sprintf(pre,"%s", "");
 		/*sprintf(pre,"%s",clear_line);*/
 	else strcpy(pre,"\r");
@@ -149,7 +149,7 @@ static void set_prompt(void)
 	}
 	else
 	{
-		if (cm_flags(user->chatmode,CM_ONCHAT,CM_MODE_ANY)) 
+		if (cm_flags(user->chatmode,CM_ONCHAT,CM_MODE_ANY))
 			snprintf(prompt,40, "%stalk{%d}-* ",pre,user->room);
 		else
 		if (u_god(user->status))
@@ -216,7 +216,7 @@ static void accept_line(char *line)
 		}
 	} else
 	{
-		
+
 		//strncpy(comm, line, MAXTEXTLENGTH-1);
 		//comm[MAXTEXTLENGTH-1] = '\0';
 		conversion_result=convert_string_charset(line, "LOCAL", strlen(line), comm, "UTF-8", MAXTEXTLENGTH-100, NULL, NULL, NULL, NULL, "?");
@@ -224,10 +224,10 @@ static void accept_line(char *line)
 		{
 			if( conversion_result & WINVALIDCHARS )
 			{
-				printf("Warning: Your input contained characters that are invalid in your current locale.\n  Please ensure your terminal and locale are using the same character set\n"); 
+				printf("Warning: Your input contained characters that are invalid in your current locale.\n  Please ensure your terminal and locale are using the same character set\n");
 			}
 			eof_count=0;
-			strip_str(comm); 
+			strip_str(comm);
 			if (new_mail_waiting==1)
 			{
 				display_message(_("\03305*** You have new mail.\n"), 1, 1);
@@ -567,13 +567,13 @@ int main(int argc, char **argv)
 			exit(-1);
 		}
 		remote=true;
-		show_new(user);  
+		show_new(user);
 		update_user(user,tmp);
 		free(user);
 		free(fold);
 		exit(0);
 	}
-	 
+
 	/* jump straight to add_mesg() */
 	if (foldername_num>-1 && god_mode())
 	{
@@ -658,9 +658,9 @@ int main(int argc, char **argv)
 		else
 		{
 			mwlog("LOGIN from %s", inet_ntoa(((struct sockaddr_in *)&sa)->sin_addr) );
-		}	
-	}	
-			
+		}
+	}
+
 	time_t when = user->lastlogout;
 	printf(_("\nLast logged out %s\n\n"),ctime(&when));
 	if (u_reg(user->status)) {
@@ -713,7 +713,7 @@ int main(int argc, char **argv)
 	user->chatmode |= (oldchat & CM_PROTMASK);
 
 	user->idletime=time(0);
-	update_user(user,userposn);	
+	update_user(user,userposn);
 
 	/* list new BBS items */
 	list_new_items(user,true);
@@ -727,10 +727,10 @@ int main(int argc, char **argv)
 	set_rights();
 
 	init_colour();
-	
+
 	RoomInit(&myroom);
 
-/*	if (!(rights&65l))  a pleb - timeout of 10 mins 
+/*	if (!(rights&65l))  a pleb - timeout of 10 mins
 		user->timeout=600; */
 	update_user(user,userposn);
 
@@ -788,14 +788,14 @@ int main(int argc, char **argv)
 				disable_rl(0);
 			}
 		}
-	}	
+	}
 }
 
 void accept_command(char *cmd)
 {
 	char history_comm[MAXTEXTLENGTH];
 	int conversion_result;
-	
+
 	if (UseRL)
 	{
 		conversion_result=convert_string_charset(cmd, "UTF-8", strlen(cmd), history_comm, "LOCAL", MAXTEXTLENGTH, NULL, NULL, NULL, NULL, NULL);
@@ -806,7 +806,7 @@ void accept_command(char *cmd)
 		}
 	}
 	if (cm_flags(user->chatmode,CM_ONCHAT,CM_MODE_ANY))
-	{	
+	{
 		if (cmd[0]==*CMD_BOARD_STR)
 		{
 			set_rights();
@@ -1013,7 +1013,7 @@ int idle(int fd, int millis)
 			fprintf(stderr, _("\nError on input terminal, argh.\n"));
 			return -1;
 		}
-		if (FD_ISSET(incoming_pipe, &readfds)) 
+		if (FD_ISSET(incoming_pipe, &readfds))
 		       handle_mesg();
 	}
 	in_idle--;
@@ -1050,7 +1050,7 @@ static void printline_in_local(char *line, int *warnings, size_t *not_in_local)
 	char local_line[MAXTEXTLENGTH];
 	int		conversion_result;
 	size_t	irreversible=0, outbyte=0, inbyte=0;
-	
+
 	conversion_result=convert_string_charset(line, "UTF-8", strlen(line), local_line, "LOCAL//TRANSLIT", MAXTEXTLENGTH, &outbyte, &irreversible, &inbyte, NULL, "#");
 	if(conversion_result>=0)
 	{
@@ -1083,7 +1083,7 @@ void display_message(const char *text, int beeps, int newline)
 	int		len;
 	int		ptr;
 	int		concealed = 0;
-	char		line[MAXTEXTLENGTH];	
+	char		line[MAXTEXTLENGTH];
 	int		i, j, colrstart;
 	int		hascolour;
 	int		screen_width = screen_w();
@@ -1146,7 +1146,7 @@ void display_message(const char *text, int beeps, int newline)
 					ptr++;
 				}
 			}
-				
+
 			/* escape sequence, skip next two chars */
 			if (s_colouroff(user->special))
 			{
@@ -1155,7 +1155,7 @@ void display_message(const char *text, int beeps, int newline)
 			hascolour++;
 
 			str[2]=0;
-			
+
 			colr=colour(str, &concealed);
 
 			if (colr!=NULL)
@@ -1207,7 +1207,7 @@ void display_message(const char *text, int beeps, int newline)
 					colrstart = -1;
 				}
 			}
-			
+
 		}
 		else
 		{
@@ -1279,7 +1279,7 @@ void display_message(const char *text, int beeps, int newline)
 	{
 		printf("Warning: %d characters in the last message could not be displayed in your current character set.\n You might want to consider using UTF-8.\n", (int)not_in_local);
 	}
-	
+
 	/*if (UseRL && inreadline) rl_forced_update_display();*/
 	if (!u_beep(user->status) && beeps)
 	{
@@ -1323,7 +1323,7 @@ static void time_out(void *idle_count_p)
 		char msg[128];
 		snprintf(msg, sizeof(msg), _("%c*** Wakey ! Wakey !\r\n"), 7);
 		idle_count++;
-		update_user(user,userposn);	
+		update_user(user,userposn);
 		write(1,msg,strlen(msg));
 	}
 	else
@@ -1331,7 +1331,7 @@ static void time_out(void *idle_count_p)
 		mwlog("TIMEOUT(BLOCKED)");
 		close_down(1, NULL, NULL);
 	}
-	
+
 }
 
 void reset_timeout(int secs)
@@ -1345,7 +1345,7 @@ void reset_timeout(int secs)
 		timeout_event_2 = alarm_after(secs+120, 0, &idle_count, &time_out);
 	}
 }
-		
+
 /* start of Readline Commands */
 
 char *dupstr(const char *text, const char *prepend)
@@ -1689,7 +1689,7 @@ char *list_commands(const char *text, int state)
 	}
 	free(rtext);
 	return(NULL);
-}	
+}
 
 /* tab completion feature for talker commands */
 char *list_chat_commands(const char *text, int state)
@@ -1718,7 +1718,7 @@ char *list_chat_commands(const char *text, int state)
 		i++;
 	}
 	return(NULL);
-}	
+}
 
 char *find_folder(const char *text, int state)
 {
@@ -1730,7 +1730,7 @@ char *find_folder(const char *text, int state)
 
 	if (state==0)
 	{
-		if (nofolders()) return(NULL);	
+		if (nofolders()) return(NULL);
 		if (file!=0) close(file);
 		if ((file=openfolderfile(O_RDONLY))<0) return NULL;
 		len=strlen(text);
@@ -1738,20 +1738,20 @@ char *find_folder(const char *text, int state)
 
 	while (get_folder_entry(file,fol))
 	{
-		if (f_active(fol->status) 
+		if (f_active(fol->status)
 		   && (allowed_r(fol,user)
 		   || allowed_w(fol,user))) /*allowed*/
 		if (len==0 || !strncasecmp(text,fol->name,len))
 			return (dupstr(fol->name, ""));
 	}
 
-	close(file);	
+	close(file);
 	file=0;
 	return(NULL);
 }
 
 
-char *part_user(const char *text, int status) 
+char *part_user(const char *text, int status)
 {
 	static int file=0;
 	static int len=0;
@@ -1759,7 +1759,7 @@ char *part_user(const char *text, int status)
 
 	if (status==0)
 	{
-		if (file!=0) close(file);	
+		if (file!=0) close(file);
 		file=userdb_open(O_RDONLY);
 		len=strlen(text);
 	}


=====================================
src/client/mesg.c
=====================================
--- a/src/client/mesg.c
+++ b/src/client/mesg.c
@@ -22,7 +22,7 @@ void send_mesg(char *from, const char *to, char *text, int wiz)
 {
 	char buff[MAXTEXTLENGTH];
 	struct person * usr;
-	
+
 	usr = user_get(to);
 	if (! usr) {
 		printf(_("User does not exist.\n"));
@@ -43,7 +43,7 @@ void send_mesg(char *from, const char *to, char *text, int wiz)
 		}
 	}
 	free(usr);
-	
+
 	snprintf(buff, MAXTEXTLENGTH, "*** %s: %s", from, text);
 	if (ipc_send_to_username(to, IPC_WIZ, buff) <= 0) {
 		printf(_("User not logged on.\n"));
@@ -70,7 +70,7 @@ void postinfo(struct person *who, struct folder *fol, struct Header *mesg)
 	ipc_send_to_all(IPC_TEXT, buff);
 }
 
-/* broadcast state  
+/* broadcast state
 0= everyone no choice
 1= login information
 2= wiz chat people only
@@ -79,7 +79,7 @@ void postinfo(struct person *who, struct folder *fol, struct Header *mesg)
 0x100= raw text, eg !su, .mrod
 */
 
-void broadcast(int state, const char *fmt, ...) 
+void broadcast(int state, const char *fmt, ...)
 {
 	char buff[MAXTEXTLENGTH];
 	char text[MAXTEXTLENGTH];
@@ -145,7 +145,7 @@ void mwlog(const char *fmt, ...)
 	time_t t;
 
 	va_start(ap, fmt);
-	
+
 	if ((file=open(LOGFILE,O_WRONLY|O_CREAT|O_APPEND,0600))<0)
 	{
 		perror("log");


=====================================
src/client/mod.c
=====================================
--- a/src/client/mod.c
+++ b/src/client/mod.c
@@ -21,7 +21,7 @@ static void add_message(struct folder *fold, struct Header *head, char *text)
 {
 	char fullpath[PATHSIZE];
 	int modindex,modtext;
-	
+
 	/* files for general public to read */
 	sprintf(fullpath,"%s/%s%s",STATEDIR,fold->name,INDEX_END);
 	if ((modindex=open(fullpath,O_WRONLY|O_APPEND|O_CREAT,0600))<0)
@@ -35,7 +35,7 @@ static void add_message(struct folder *fold, struct Header *head, char *text)
 	head->datafield=lseek(modtext,0,2);
 	if (write(modindex,head,sizeof(*head))<0) {perror("mod: writehead");}
 	if (write(modtext,text,head->size)<0) {perror("mod: write text");}
-	
+
 	Unlock_File(modtext);
 	Unlock_File(modindex);
 	close(modtext);
@@ -46,7 +46,7 @@ static void put_back(struct folder *fold, struct Header *head, char *text)
 {
 	char fullpath[PATHSIZE];
 	int newindex,newtext;
-	
+
 		/* files to put messages to be approved later */
 	sprintf(fullpath,"%s/%s%s%s",STATEDIR,fold->name,INDEX_END,MOD_END);
 	if ((newindex=open(fullpath,O_WRONLY|O_APPEND|O_CREAT,0600))<0)
@@ -72,12 +72,12 @@ static void store(struct folder *fold, struct Header *head, char *text)
 	char buff[128];
 	char fullpath[PATHSIZE];
 	time_t head_date;
-	
+
 	sprintf(fullpath,"%s/%s",STATEDIR,"mod.save");
 	head_date = (time_t)head->date;
 	if ((afile=open(fullpath,O_WRONLY|O_APPEND|O_CREAT,0600))<0)
 		{perror(fullpath);exit(-1);}
-	
+
 	Lock_File(afile);
 	sprintf(buff,_("\nMessage in folder %s\nFrom: %s\nTo: %s\nSubject: %s\nDate: %s"),
 	        fold->name, head->from, head->to, head->subject, ctime(&head_date));
@@ -94,11 +94,11 @@ void moderate(void)
 	struct Header head;
 	char *text;
 	char answer[11];
-		
+
 	int f_file;
 	int tmpindex,tmptext;
-	
-	if ((f_file=open(FOLDERFILE,O_RDWR))<0) 
+
+	if ((f_file=open(FOLDERFILE,O_RDWR))<0)
 		{perror(FOLDERFILE);exit(-1);}
 	while (get_folder_entry(f_file,&fold))
 	{
@@ -112,10 +112,10 @@ void moderate(void)
 		sprintf(oldpath,"%s/%s%s%s",STATEDIR,fold.name,TEXT_END,MOD_END);
 		sprintf(fullpath,"%s/%s%s%s",STATEDIR,fold.name,TEXT_END,".tmp");
 		rename(oldpath,fullpath);
-		
+
 		/* files containing messages to be approved */
 		sprintf(fullpath,"%s/%s%s%s",STATEDIR,fold.name,INDEX_END,".tmp");
-		if ((tmpindex=open(fullpath,O_RDONLY))<0) 
+		if ((tmpindex=open(fullpath,O_RDONLY))<0)
 			{perror(fullpath);exit(-1);}
 		sprintf(fullpath,"%s/%s%s%s",STATEDIR,fold.name,TEXT_END,".tmp");
 		if ((tmptext=open(fullpath,O_RDONLY))<0)


=====================================
src/client/new.c
=====================================
--- a/src/client/new.c
+++ b/src/client/new.c
@@ -35,16 +35,16 @@ void list_new_items(struct person *user, int flag)
 	struct folder folstuff;
 	struct folder *fol=&folstuff;
 	int screen_height=screen_h();
-	
+
 	if (nofolders())
-		{printf(_("There are no folders to read !\n")); return;}	
+		{printf(_("There are no folders to read !\n")); return;}
 	file=openfolderfile(O_RDONLY);
 	while (get_folder_entry(file,fol))
 	{
-		if (f_active(fol->status) 
+		if (f_active(fol->status)
 		   && (allowed_r(fol,user)
 		   || allowed_w(fol,user))) /*allowed*/
-		if (!flag || (flag && (fol->last-user->lastread[count])>0 
+		if (!flag || (flag && (fol->last-user->lastread[count])>0
 		          && allowed_r(fol,user)
 		          && get_subscribe(user,count))) /* subscribed */
 		{
@@ -87,16 +87,16 @@ static int read_new(struct person *user, struct folder *data, int folnum)
 	struct Header head;
 	char tmp[80];
 
-	if (access(buildpath(STATEDIR,data->name,INDEX_END,""),0)) 
+	if (access(buildpath(STATEDIR,data->name,INDEX_END,""),0))
 		{printf(_("Error: cannot find index file for folder %s\n"),data->name);return(-1);}
-	if (access(buildpath(STATEDIR,data->name,TEXT_END,""),0)) 
+	if (access(buildpath(STATEDIR,data->name,TEXT_END,""),0))
 		{printf(_("Error: cannot find text file for folder %s\n"),data->name); return(-1);}
 	if ((indexfile=err_open(buildpath(STATEDIR,data->name,INDEX_END,""),O_RDONLY,0))<0)
 		{exit(-1);}
 	if ((datafile=err_open(buildpath(STATEDIR,data->name,TEXT_END,""),O_RDONLY,0))<0)
 		{exit(-1);}
 
-	/* try jumping to expected location */	
+	/* try jumping to expected location */
 	posn=(user->lastread[folnum]-data->first+1)*sizeof(struct Header);
 	lseek(indexfile,posn,0);
 	/* read the article, if failed, or overshot then rewind to start */
@@ -158,7 +158,7 @@ static int read_new(struct person *user, struct folder *data, int folnum)
 				printf(_("Unsubscribing from %s.\n"),data->name);
 				break;
 			}else
-			if (strlen(tmp)) 
+			if (strlen(tmp))
 			{
 				extern int last_mesg,currentfolder;
 				close(datafile);
@@ -177,11 +177,11 @@ static int read_new(struct person *user, struct folder *data, int folnum)
 }
 
 void show_new(struct person *user)
-{		
-	struct folder *data;	
+{
+	struct folder *data;
 	int folderfile;
 	int folnum=0;
-	
+
 	data=(struct folder *)malloc(sizeof(*data));
 
 	if (nofolders())
@@ -189,15 +189,15 @@ void show_new(struct person *user)
 		printf(_("There are no folders to read !\n"));
 		free(data);
 		return;
-	}	
+	}
 	folderfile=openfolderfile(O_RDONLY);
 	while (get_folder_entry(folderfile,data))
 	{
 		if (data->status&1 /*active*/
-		&& allowed_r(data,user) /* allowed to read */ 
+		&& allowed_r(data,user) /* allowed to read */
 	    	&& get_subscribe(user,folnum)  /* currently subscribed */
 		&& !(data->last<data->first || data->last==0)
-		&& !(data->last<=user->lastread[folnum])) 
+		&& !(data->last<=user->lastread[folnum]))
 		{
 			if (!remote)
 			{
@@ -217,7 +217,7 @@ void latest(struct person *user)
 	int ffile,ifile;
 	struct folder fold;
 	char datestr[30],sub[40];
-	
+
 	if (nofolders())
 	{
 		printf(_("There are no folders to read !\n"));


=====================================
src/client/newmain.c
=====================================
--- a/src/client/newmain.c
+++ b/src/client/newmain.c
@@ -47,7 +47,7 @@ extern unsigned long rights;
 extern struct person *user;
 extern struct folder *fold;
 extern long userposn;
-extern unsigned long loggedin; 
+extern unsigned long loggedin;
 extern CommandList table[];
 extern void help_list(CommandList *cm, unsigned int hidestuff);
 
@@ -280,7 +280,7 @@ void c_colouroff(CommandList *cm, int argc, const char **argv, char *args)
 		if (get_colour()==NULL)
 			printf(_("No colour scheme loaded.\n"));
 		printf(_("Current colour scheme: %d: %s\n"),user->colour,get_colour());
-		
+
 		return;
 	}
 
@@ -337,7 +337,7 @@ void c_colouroff(CommandList *cm, int argc, const char **argv, char *args)
 		i=atoi(argv[1]);
 		snprintf(path, 1023, COLOURDIR"/%d.col", i);
 		if (access(path, R_OK))
-		{	
+		{
 			printf(_("ERROR: Cannot open colour scheme '%d'\n"),i);
 			return;
 		}
@@ -444,7 +444,7 @@ void c_autosub(CommandList *cm, int argc, const char **argv, char *args)
 void c_su(CommandList *cm, int argc, const char **argv, char *args)
 {
 	int z=BoolOpt(argv[1]);
-	
+
 	if (z==1)
 	{
 		if (!u_god(user->status))
@@ -674,7 +674,7 @@ void c_tidyup(CommandList *cm, int argc, const char **argv, char *args)
 
 	char fullpath[PATHSIZE];
 	char fullpath2[PATHSIZE];
-	
+
 	if (argc!=3)
 	{
 	 	printf("Usage: tidyup <foldername> <mesg no>\n");
@@ -687,7 +687,7 @@ void c_tidyup(CommandList *cm, int argc, const char **argv, char *args)
 		perror("folders");
 		exit(-1);
 	}
-	
+
 	do {
 		i=read(ffile,&info,sizeof(info));
 	}while (i==sizeof(info) && !stringcmp(info.name,argv[1],-1));
@@ -852,7 +852,7 @@ void c_mod(CommandList *cm, int argc, const char **argv, char *args)
 void c_passwd(CommandList *cm, int argc, const char **argv, char *args)
 {
 	char pw1[PASSWDSIZE], pw2[PASSWDSIZE], salt[3];
-		
+
 	salt[2]=0;
 	strncpy(salt,user->passwd,2);
 	if (strcmp(user->passwd,crypt(get_pass(_("Enter old password: ")),salt)))
@@ -963,10 +963,10 @@ void c_status(CommandList *cm, int argc, const char **argv, char *args)
 	printf(_("You are currently in folder %s, which you "),fold->name);
 	printf(get_subscribe(user,currentfolder)?_("are"):_("are not"));
 	printf(_(" subscribed to.\n"));
-	if (user->timeout==0) 
+	if (user->timeout==0)
 		printf(_("You will not be timed out for being idle.\n"));
-	else 
-		printf(_("You will be timed out after being idle for %s.\n"),itime(user->timeout));	
+	else
+		printf(_("You will be timed out after being idle for %s.\n"),itime(user->timeout));
 	time_on(user->timeused+(time(0) - loggedin));
 }
 
@@ -1052,7 +1052,7 @@ void c_catchup(CommandList *cm, int argc, const char **argv, char *args)
 		if(!f_active(fold->status) || (!allowed_r(fold,user) && !allowed_w(fold,user)))
 		{
 			printf(_("There is no folder %s\n"), argv[1]);
-			get_folder_number(fold,currentfolder);	
+			get_folder_number(fold,currentfolder);
 			return;
 		}
 	}else
@@ -1063,7 +1063,7 @@ void c_catchup(CommandList *cm, int argc, const char **argv, char *args)
 	user->lastread[i]=fold->last;
 	update_user(user,userposn);
 	printf(_("Marking folder %s as read.\n"),fold->name);
-	get_folder_number(fold,currentfolder);	
+	get_folder_number(fold,currentfolder);
 }
 
 void c_date(CommandList *cm, int argc, const char **argv, char *args)
@@ -1083,10 +1083,10 @@ void c_save(CommandList *cm, int argc, const char **argv, char *args)
 	int msg=atoi(argv[1]);
 	char buff[128],file[128];
 	FILE *f;
-	
-	int i,len,x;	
 
-	len=strlen(argv[2]);	
+	int i,len,x;
+
+	len=strlen(argv[2]);
 	for(i=0;i<len;i++)
 	{
 		if (argv[2][i]=='/') file[i]='_';
@@ -1127,7 +1127,7 @@ void c_save(CommandList *cm, int argc, const char **argv, char *args)
 		if (x==-1)
 			perror("wait");
 	}
-}	
+}
 
 void c_timeout(CommandList *cm, int argc, const char **argv, char *args)
 {


=====================================
src/client/read.c
=====================================
--- a/src/client/read.c
+++ b/src/client/read.c
@@ -36,14 +36,14 @@ int get_data(int afile, struct Header *tmp)
 	}
 	return(true);
 }
-	
+
 void display_article(struct Header *tmp, int datafile)
 {
 	int i,length;
 	char *buff,*ptr;
 	char title[80];
 	time_t when;
-	
+
 	buff=(char *)malloc(tmp->size);
 
 	if (!remote)
@@ -61,9 +61,9 @@ void display_article(struct Header *tmp, int datafile)
 		printf("Message: %d\nFrom: %s\nDate: %ld\n",tmp->Ref,tmp->from,(long)tmp->date);
 		show_mesg_stats(tmp->status,title,false);
 		printf("Flags: %s\n",title);
-	}	
+	}
 	fprintf(output,"To: %s\nSubject: %s\n",tmp->to,tmp->subject);
-	
+
 	if (tmp->replyto>0)
 		fprintf(output,"In reply to message %d.\n",tmp->replyto);
 	if (tmp->status&(1<<2))
@@ -91,7 +91,7 @@ void display_article(struct Header *tmp, int datafile)
 			putchar(*p);
 			if (*p=='\n' && p[1]=='.') putchar('.');
 			p++;
-		}	
+		}
 		printf("\n.\n");
 	}
 	free(buff);
@@ -104,7 +104,7 @@ int read_msg(int folnum, int msgnum, struct person *user)
 	struct Header head;
 	int posn;
 	long tmppos;
-	char *x;	
+	char *x;
 
 	if (nofolders())
 		{printf("There are no folders to read.\n");return(false);}
@@ -114,7 +114,7 @@ int read_msg(int folnum, int msgnum, struct person *user)
 	for (i=0;i<=folnum;i++) get_folder_entry(file,&data);
 
 	close(file);
-	
+
 	if (!(data.status&1))
 		{printf("That folder does not exist.\n");return(false);}
 	if (msgnum>data.last || msgnum<data.first)
@@ -123,9 +123,9 @@ int read_msg(int folnum, int msgnum, struct person *user)
 		{printf("Folder %s is empty.\n",data.name);return(false);}
 	if ( !u_god(user->status) && !allowed_r(&data,user))
 		{printf("You are not permitted to read this folder.\n");return(false);}
-		
+
 	x=buildpath(STATEDIR,data.name,INDEX_END,"");
-	if (access(x,0)) 
+	if (access(x,0))
 	{
 		printf("Error: cannot find index file for folder %s\n",data.name);
 		return(false);
@@ -134,7 +134,7 @@ int read_msg(int folnum, int msgnum, struct person *user)
 		{exit(-1);}
 
 	x=buildpath(STATEDIR,data.name,TEXT_END,"");
-	if (access(x,0)) 
+	if (access(x,0))
 	{
 		printf("Error: cannot find text file for folder %s\n",data.name);
 		close(headfile);
@@ -158,7 +158,7 @@ int read_msg(int folnum, int msgnum, struct person *user)
 		{
 			printf("Message has been marked for deletion.\n");
 		}else
-		if (is_private(&data,user) && 
+		if (is_private(&data,user) &&
 		  (!stringcmp(head.to,user->name,-1)&&!stringcmp(head.from,user->name,-1)))
 		{
 			printf("This message is not addressed to you !\n");
@@ -179,7 +179,7 @@ void ls(int folnum, struct person *user, int many)
 	int afile;
 	struct folder fold;
 	struct Header head;
-	char buff[SUBJECTSIZE+1];	
+	char buff[SUBJECTSIZE+1];
 	int linecount=0;
 	int listpoint;
 	int screen_height = screen_h();
@@ -220,7 +220,7 @@ void ls(int folnum, struct person *user, int many)
 		                     ||stringcmp(head.to,user->name,-1))))) /*marked for deletion*/
 		{
 			strncpy(buff,head.to,NAMESIZE);
-			buff[NAMESIZE]=0; 
+			buff[NAMESIZE]=0;
 			printf("%4d  %*s -> %*s  ",
 			head.Ref,NAMESIZE,head.from,NAMESIZE,buff);
 			if (strlen(head.subject)>40)
@@ -243,10 +243,10 @@ void ls(int folnum, struct person *user, int many)
 				printf("            \r");
 				linecount=0;
 			}
-				
+
 		}
 	}
-	close(afile); 
+	close(afile);
 }
 
 void more(char *buff, int size)
@@ -255,7 +255,7 @@ void more(char *buff, int size)
 	int len=0,found=5;
 	char tmp[2];
 	int scr_h = screen_h();
-	
+
 	ptr=buff;
 	while ((ptr+len)<(buff+size))
 	{
@@ -289,7 +289,7 @@ int get_mesg_header(struct folder *data, int msgnum, struct Header *head)
 	int		headfile;
 	int		posn;
 	long		tmppos;
-	char		*x;	
+	char		*x;
 
 	/* folder data doesnt exist */
 	if (!data) return(false);


=====================================
src/client/script.c
=====================================
--- a/src/client/script.c
+++ b/src/client/script.c
@@ -84,7 +84,7 @@ char ** makeargs(int argc, const char **argv, int offset)
 		new[i]=strdup(argv[offset+i]);
 	}
 	new[num]=NULL;
-	
+
 	return (new);
 }
 
@@ -99,7 +99,7 @@ static int endchar(const char *haystack, char needle)
 {
 	int len;
 	len=strlen(haystack);
-	if (haystack[len-1] == needle) return (1); 
+	if (haystack[len-1] == needle) return (1);
 	else return(0);
 }
 
@@ -387,7 +387,7 @@ void DestroyFunction(const char *funcname)
 
 	func=function_list;
 	funcold=NULL;
-	while (func!=NULL && strcasecmp(funcname, func->name)) 
+	while (func!=NULL && strcasecmp(funcname, func->name))
 	{
 		funcold=func;
 		func=func->next;
@@ -396,12 +396,12 @@ void DestroyFunction(const char *funcname)
 		printf("Cant find function %s to destroy.\n", funcname);
 		return;
 	}
-	if (funcold==NULL) 
+	if (funcold==NULL)
 		function_list=func->next;
 	else
 		funcold->next=func->next;
 	free(func->name);
-	
+
 	label=func->jump;
 	while (label!=NULL) {
 		struct label *oldlabel;
@@ -411,13 +411,13 @@ void DestroyFunction(const char *funcname)
 		free (label);
 		label=oldlabel;
 	}
-	
+
 	fcode=func->code;
 	while (fcode!=NULL) {
 		int i;
 		struct code *oldcode;
 		free(fcode->debug);
-		for (i=0;i<fcode->argc;i++) 
+		for (i=0;i<fcode->argc;i++)
 			free(fcode->argv[i]);
 		free(fcode->argv);
 		oldcode=fcode->next;
@@ -458,7 +458,7 @@ void DestroyAllFunctions(int debug)
 			int i;
 			struct code *oldcode;
 			free(fcode->debug);
-			for (i=0;i<fcode->argc;i++) 
+			for (i=0;i<fcode->argc;i++)
 				free(fcode->argv[i]);
 			free(fcode->argv);
 			oldcode=fcode->next;
@@ -488,7 +488,7 @@ void scr_helpfile(const char *args)
 		printf("Sorry, no help available on that subject. *:-)\n");
 		return;
 	}
-	
+
 	if (args==NULL)
 	{
 		x=makepath(SCRIPTHELP,"/","general");
@@ -588,7 +588,7 @@ void ListVars(const char *srch)
 		}
 		VAR_LIST_NEXT(&op);
 	}
-} 
+}
 
 /***************
  ** Runtime...
@@ -865,14 +865,14 @@ int ExecEvent(char *script, const char *text, const char *event, char *who, int 
 	if (event_body_text!=NULL) free(event_body_text);
 	event_body_text = strdup(text+pre);
 	/*ARG_STR_FORCE(&args, 3, strdup(event_body_text)); */
-	
+
 	busy++;
 	retval = ExecScript(script, &args, 0);
 	VAR_FREELIST(&args);
 	busy--;
 
 	return(retval);
-}	
+}
 
 
 int ExecEvent2(char *script, const char *event, char *who, int pre, int numargs, char *aargs[])
@@ -931,7 +931,7 @@ int ExecEvent2(char *script, const char *event, char *who, int pre, int numargs,
 	busy--;
 
 	return(retval);
-}	
+}
 
 void ListScript(const char *name)
 {
@@ -970,7 +970,7 @@ char *eval_arg(char *arg, int argc, char **argv)
 	return strdup("{error}");
     }
 }
-	
+
 char ** argv_shift(int argc, char **argv, int offset, int *newsize)
 {
 	char **new;
@@ -1057,7 +1057,7 @@ void ScriptCleanup(void)
 	if (homedir) free (homedir);
 }
 
-void scr_devel_msg(struct code *pc, const char *fmt, ...) 
+void scr_devel_msg(struct code *pc, const char *fmt, ...)
 {
 	va_list va;
 	char text[MAXTEXTLENGTH];
@@ -1072,7 +1072,7 @@ void scr_devel_msg(struct code *pc, const char *fmt, ...)
 /* script function autocompletion for readline */
 char *list_script(const char *text, int state)
 {
-	static int len;   
+	static int len;
 	static struct function *fn = NULL;
 	char *name;
 	int hidden;


=====================================
src/client/script.h
=====================================
--- a/src/client/script.h
+++ b/src/client/script.h
@@ -94,7 +94,7 @@ do { \
 
 #define ARG_RANGE(list1, min, max) VAR_INT_FORCE(list1, "#", (max)+1); \
 
-#define ARG_COUNT(list1) 
+#define ARG_COUNT(list1)
 
 #define VAR_STR_FORCE(list1, name1, val1) \
 do { \
@@ -202,7 +202,7 @@ struct code {
 struct label {
 	char *name;
 	struct code *where;
-	
+
 	char *debug;
 	struct label *next;
 };


=====================================
src/client/script_inst.c
=====================================
--- a/src/client/script_inst.c
+++ b/src/client/script_inst.c
@@ -164,7 +164,7 @@ void scr_time( struct code *pc, int fargc, char **fargv )
 	{
 		AUTOFREE_BUFFER uname = eval_arg(pc->argv[1], fargc, fargv);
 
-		if (script_debug) escprintf("- %s: Getting idletime of user '%s'.\n", pc->inst->name, uname); 
+		if (script_debug) escprintf("- %s: Getting idletime of user '%s'.\n", pc->inst->name, uname);
 
 		json_t * wlist = grab_wholist();
 		if (wlist == NULL)
@@ -220,14 +220,14 @@ void scr_say( struct code *pc, int fargc, char **fargv )
 	AUTOFREE_BUFFER p = NULL;
 	char utf8buff[MAXTEXTLENGTH];
 	int conversion_result;
-	
+
 	if (pc->argc==0) return;
 	if (!cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_ANY)) return;
 
 	size=0;
 	for (i=0; i<pc->argc; i++)
 		size+=strlen(pc->argv[i])+1;
-	
+
 	/* overly generous allocation as later code isnt clean. */
 	size+=512;
 	tmp=(char *)malloc(size);
@@ -261,12 +261,12 @@ void scr_say( struct code *pc, int fargc, char **fargv )
 	{
 		printf("Error: Your script produced invalid utf-8 which has not been sent.\n");
 		return;
-	}		
+	}
 	if(conversion_result & WOUTPUTTOOSHORT)
 	{
 		printf("Warning: Your script produced too much text which has been truncated.\n");
-	}		
-	
+	}
+
 
 
 	if (!strcasecmp(pc->inst->name, "say"))
@@ -313,7 +313,7 @@ void scr_output( struct code *pc, int fargc, char **fargv )
 		return;
 	}
 	what=eval_arg(pc->argv[0], fargc, fargv);
-	
+
 	if ((i=BoolOpt(what))==-1)
 	{
 		if (script_debug) printf("- OUTPUT: Error, invalid argument\n");
@@ -325,7 +325,7 @@ void scr_wholist( struct code *pc, int fargc, char **fargv )
 {
 	AUTOFREE_BUFFER what = NULL;
 	AUTOFREE_BUFFER buff = NULL;
-	
+
 	if (pc->argc < 1) {
 		if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
 		return;
@@ -349,7 +349,7 @@ void scr_wholist( struct code *pc, int fargc, char **fargv )
 		}
 	}
 	json_decref(wlist);
-	
+
 	{
 		char *p;
 		if ((p=strrchr(buff,' '))!=NULL) *p=0;
@@ -367,9 +367,9 @@ void scr_roomnum( struct code *pc, int fargc, char **fargv )
 	rn[0] = '-';
 	rn[1] = '1';
 	rn[2] = 0;
-	
+
 	if (pc->argc < pc->inst->args) {
-		if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug); 
+		if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
 		return;
 	}
 	what=eval_arg(pc->argv[0], fargc, fargv);
@@ -407,7 +407,7 @@ void scr_roomnum( struct code *pc, int fargc, char **fargv )
 
 		uname=eval_arg(pc->argv[1], fargc, fargv);
 
-		if (script_debug) escprintf("- %s: Getting room of user '%s'.\n", pc->inst->name, uname); 
+		if (script_debug) escprintf("- %s: Getting room of user '%s'.\n", pc->inst->name, uname);
 
 		json_t * wlist = grab_wholist();
 		if (wlist == NULL) return;
@@ -472,7 +472,7 @@ void scr_quit( struct code *pc, int fargc, char **fargv )
 	close_down(0, NULL, NULL);
 }
 
-void scr_exec( struct code *pc, int fargc, char **fargv ) 
+void scr_exec( struct code *pc, int fargc, char **fargv )
 {
 	char *p;
 
@@ -607,7 +607,7 @@ int isanumul(const char *a, unsigned long *result, int onlydecimal)
 	}
 }
 
-void scr_compare( struct code *pc, int fargc, char **fargv ) 
+void scr_compare( struct code *pc, int fargc, char **fargv )
 {
 	AUTOFREE_BUFFER a = NULL;
 	AUTOFREE_BUFFER b = NULL;
@@ -621,7 +621,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 
 	compare_count++;
 
-	a=eval_arg(pc->argv[0], fargc, fargv);	
+	a=eval_arg(pc->argv[0], fargc, fargv);
 	b=eval_arg(pc->argv[1], fargc, fargv);
 
 	if (isanum(a, &aa, 0) && isanum(b, &bb, 0)) {
@@ -635,7 +635,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 	}
 
 	if (!strcasecmp(pc->inst->name, "eq"))
-	{	
+	{
 		if (numeric) {
 			if (aa==bb) compare_match++;
 		} else {
@@ -643,7 +643,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 		}
 	}else
 	if (!strcasecmp(pc->inst->name, "ne"))
-	{	
+	{
 		if (numeric) {
 			if (aa!=bb) compare_match++;
 		} else {
@@ -651,7 +651,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 		}
 	}else
 	if (!strcasecmp(pc->inst->name, "lt"))
-	{	
+	{
 		if (numeric) {
 			if (aa<bb) compare_match++;
 		} else {
@@ -659,7 +659,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 		}
 	}else
 	if (!strcasecmp(pc->inst->name, "gt"))
-	{	
+	{
 		if (numeric) {
 			if (aa>bb) compare_match++;
 		} else {
@@ -667,7 +667,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 		}
 	}else
 	if (!strcasecmp(pc->inst->name, "le"))
-	{	
+	{
 		if (numeric) {
 			if (aa<=bb) compare_match++;
 		} else {
@@ -675,7 +675,7 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
 		}
 	}else
 	if (!strcasecmp(pc->inst->name, "ge"))
-	{	
+	{
 		if (numeric) {
 			if (aa>=bb) compare_match++;
 		} else {
@@ -721,7 +721,7 @@ void scr_math( struct code *pc, int fargc, char **fargv )
 	}
 
 	if (script_debug) escprintf("- math operation on $%s (%d) and %d\n", aa, a, b);
-	
+
 	if (!strcasecmp(pc->inst->name, "add"))
 		result = a+b;
 	else
@@ -791,7 +791,7 @@ void scr_math2( struct code *pc, int fargc, char **fargv )
 	}
 
 	if (script_debug) printf("- math operation on %d\n", a);
-	
+
 	if (!strcasecmp(pc->inst->name, "abs"))
 	{
 		if (a>0) result = a; else result = -a;
@@ -1180,7 +1180,7 @@ void scr_local(struct code *pc, int fargc, char **fargv )
 	}
 }
 
-void scr_return( struct code *pc, int fargc, char **fargv ) 
+void scr_return( struct code *pc, int fargc, char **fargv )
 {
 	if (pc->argc >= 1)
 	{
@@ -1191,7 +1191,7 @@ void scr_return( struct code *pc, int fargc, char **fargv )
 	{
 		VAR_STR_FORCE(local_vars, "?", "");
 	}
-	
+
 	script_terminate=1;
 }
 
@@ -1214,7 +1214,7 @@ void scr_jump( struct code *pc, int fargc, char **fargv )
 		compare_count=0;
 		return;
 	}
-	
+
 	if (pc->argc<1) {
 		if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
 		return;
@@ -1301,7 +1301,7 @@ void scr_jump( struct code *pc, int fargc, char **fargv )
 	free(where);
 }
 
-void scr_end( struct code *pc, int fargc, char **fargv ) 
+void scr_end( struct code *pc, int fargc, char **fargv )
 {
 	script_terminate=2;
 }
@@ -1526,7 +1526,7 @@ void scr_input( struct code *pc, int fargc, char **fargv )
 	if (prompt!=NULL) free(prompt);
 }
 
-void scr_regex( struct code *pc, int fargc, char **fargv ) 
+void scr_regex( struct code *pc, int fargc, char **fargv )
 {
 #define MAX_REGMATCHES	100
 
@@ -1740,7 +1740,7 @@ void scr_regex( struct code *pc, int fargc, char **fargv )
 #undef MAX_REGMATCHES
 }
 
-void scr_string( struct code *pc, int fargc, char **fargv ) 
+void scr_string( struct code *pc, int fargc, char **fargv )
 {
 	char *what=NULL;
 	char *part=NULL;
@@ -1870,7 +1870,7 @@ void scr_string( struct code *pc, int fargc, char **fargv )
 	if (!strcasecmp(pc->inst->name, "strmid"))
 	{
 		int start, end, i, size;
-		char *c,  *frag;	
+		char *c,  *frag;
 
 		frag=part;
 		size=strlen(text)-1;
@@ -1913,7 +1913,7 @@ void scr_string( struct code *pc, int fargc, char **fargv )
 			text[end+1]=0;
 			value=strdup( &text[start] );
 		}
-	}	
+	}
 
 	var_str_force_2(what, value);
 
@@ -1923,7 +1923,7 @@ void scr_string( struct code *pc, int fargc, char **fargv )
 	if (text!=NULL) free(text);
 }
 
-void scr_case( struct code *pc, int fargc, char **fargv ) 
+void scr_case( struct code *pc, int fargc, char **fargv )
 {
 	char *what;
 	char *value=NULL;
@@ -1951,13 +1951,13 @@ void scr_case( struct code *pc, int fargc, char **fargv )
 			value[i] = tolower(value[i]);
 		}
 	}
-	
+
 	var_str_force_2(what, value);
 	free(value);
 	free(what);
 }
 
-void scr_base( struct code *pc, int fargc, char **fargv ) 
+void scr_base( struct code *pc, int fargc, char **fargv )
 {
 	char *what;
 	char *value=NULL;
@@ -1971,7 +1971,7 @@ void scr_base( struct code *pc, int fargc, char **fargv )
 
 	if (!strcasecmp(pc->inst->name, "toascii")) {
 		int i;
-		
+
 		if (!isanum(value, &i, 0)) {
 			if (script_debug) escprintf("- toascii: cant convert number '%s' to a char, cos its not a number\n", value);
 			free(what);
@@ -1990,7 +1990,7 @@ void scr_base( struct code *pc, int fargc, char **fargv )
 		free(value);
 		value=strdup(buff);
 	}
-	
+
 	var_str_force_2(what, value);
 	free(value);
 	free(what);
@@ -2034,7 +2034,7 @@ void scr_user( struct code *pc, int fargc, char **fargv )
 	free(value);
 	free(what);
 }
-	
+
 void scr_version( struct code *pc, int fargc, char **fargv )
 {
 	char *what;
@@ -2282,7 +2282,7 @@ void scr_listvars( struct code *pc, int fargc, char **fargv )
 	if (srch) free(srch);
 	free(text);
 	free(what);
-} 
+}
 
 
 void scr_logoninfo( struct code *pc, int fargc, char **fargv )


=====================================
src/client/sort.h
=====================================
--- a/src/client/sort.h
+++ b/src/client/sort.h
@@ -7,7 +7,7 @@ struct listing
 {
 	char name[NAMESIZE+1];
 	int count;
-	int size; 
+	int size;
 	struct listing *next;
 };
 


=====================================
src/client/sqlite.c
=====================================
--- a/src/client/sqlite.c
+++ b/src/client/sqlite.c
@@ -74,16 +74,16 @@ struct js_db_result* js_db_query(char *dbname, char *query)
 
 	sqlite3 *db;
 	new = malloc(sizeof(struct js_db_result));
-	
+
 	if(new == NULL) {
 		return NULL;
 	}
-	
-	new->error_text=NULL;	
+
+	new->error_text=NULL;
 	new->query_error=0;
 	new->db_error=0;
-	
-	
+
+
 	if (dbname == NULL) {
 		new->error_text=strdup("Database name was NULL");
 		new->db_error=-1;
@@ -105,7 +105,7 @@ struct js_db_result* js_db_query(char *dbname, char *query)
 		db_close(db);
 		return new;
 	}
-	
+
 	new->query_result->rows = -1;
 	new->query_result->cols = -1;
 	new->query_result->colNames = NULL;


=====================================
src/client/talker.c
=====================================
--- a/src/client/talker.c
+++ b/src/client/talker.c
@@ -50,7 +50,7 @@ extern unsigned long rights;
 extern struct person *user;
 extern struct folder *fold;
 extern int32_t userposn;
-extern unsigned long loggedin; 
+extern unsigned long loggedin;
 extern int quietmode;
 static int runautoexec = 1;
 
@@ -106,7 +106,7 @@ void talk_send_emote(char * text, int channel, int plural){
 	talk_send_to_room(text, channel, "emote", plural);
 }
 
-void talk_sayto(char *text, const char *to, const char *type) 
+void talk_sayto(char *text, const char *to, const char *type)
 {
 	ipc_message_t * msg = ipcmsg_create(IPC_SAYTOUSER, userposn);
 	json_t * j = json_init(NULL);
@@ -228,10 +228,10 @@ void t_showvars(CommandList *cm, int argc, const char **argv, char *args)
 void t_event(CommandList *cm, int argc, const char **argv, char *args)
 {
 	/* no arguments */
-	if (argc < 2)  
+	if (argc < 2)
 	{
 		char	*event_text = NULL;
-		int	event_count = 0;   
+		int	event_count = 0;
 
 		/* show list of events */
 		while((event_text = NextLink(event_list, event_text)) != NULL)
@@ -249,7 +249,7 @@ void t_event(CommandList *cm, int argc, const char **argv, char *args)
 	else
 		printf("Event '%s' added!\n", argv[1]);
 }
- 
+
 void t_unevent(CommandList *cm, int argc, const char **argv, char *args)
 {
 	if (!strcasecmp("*", argv[1]))
@@ -258,7 +258,7 @@ void t_unevent(CommandList *cm, int argc, const char **argv, char *args)
 		printf("All Events Destroyed!\n");
 	}
 	else
-	{   
+	{
 		if (!DestroyLink(&event_list, argv[1]))
 			printf("Event '%s' was not found!\n", argv[1]);
 		else
@@ -350,7 +350,7 @@ void t_destroy(CommandList *cm, int argc, const char **argv, char *args)
 		printf("Specify the function to destroy.\n");
 		return;
 	}
-	
+
 	if (!strcmp(argv[1],"*")) DestroyAllFunctions(1); else DestroyFunction(argv[1]);
 }
 
@@ -388,10 +388,10 @@ void t_restart(CommandList *cm, int argc, const char **argv, char *args)
 	DestroyAllLinks(&ipc_list); ipc_list = NULL;
 	DestroyAllLinks(&force_list); force_list = NULL;
 	DestroyAllLinks(&shutdown_list); shutdown_list = NULL;
-	
+
 	stop_js();
 	setup_js();
-	
+
 	RoomDestroy(&myroom);
 
 	RoomInit(&myroom);
@@ -520,7 +520,7 @@ void t_emote(CommandList *cm, int argc, const char **argv, char *args)
 	text[0] = 0;
 	strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
 
-	talk_send_emote(text,user->room,0);	
+	talk_send_emote(text,user->room,0);
 }
 
 void t_emotes(CommandList *cm, int argc, const char **argv, char *args)
@@ -530,7 +530,7 @@ void t_emotes(CommandList *cm, int argc, const char **argv, char *args)
 	text[0] = 0;
 	strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
 
-	talk_send_emote(text,user->room,1);	
+	talk_send_emote(text,user->room,1);
 }
 
 void t_emotes2(CommandList *cm, int argc, const char **argv, char *args)
@@ -540,7 +540,7 @@ void t_emotes2(CommandList *cm, int argc, const char **argv, char *args)
 	text[0] = 0;
 	strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
 
-	talk_send_emote(text,user->room,2);	
+	talk_send_emote(text,user->room,2);
 }
 
 void t_emoted(CommandList *cm, int argc, const char **argv, char *args)
@@ -550,7 +550,7 @@ void t_emoted(CommandList *cm, int argc, const char **argv, char *args)
 	text[0] = 0;
 	strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
 
-	talk_send_emote(text,user->room,3);	
+	talk_send_emote(text,user->room,3);
 }
 
 void t_emotell(CommandList *cm, int argc, const char **argv, char *args)
@@ -560,7 +560,7 @@ void t_emotell(CommandList *cm, int argc, const char **argv, char *args)
 	text[0] = 0;
 	strncat(text, args, MAXTEXTLENGTH - strlen(text) - 1);
 
-	talk_send_emote(text,user->room,4);	
+	talk_send_emote(text,user->room,4);
 }
 
 void t_global(CommandList *cm, int argc, const char **argv, char *args)
@@ -1015,7 +1015,7 @@ void t_room(CommandList *cm, int argc, const char **argv, char *args)
 	case 4:
 		display_message("Invalid Room ID (0-65535 only)", 1, 1);
 		break;
-	}	
+	}
 }
 
 void t_linewrap(CommandList *cm, int argc, const char **argv, char *args)
@@ -1056,7 +1056,7 @@ void t_topic(CommandList *cm, int argc, const char **argv, char *args)
 		if (topic != NULL && *topic != 0) {
 			asprintf(&buff, "Topic: %s\n", topic);
 		} else {
-			asprintf(&buff, "No Topic is set for channel %d.\n", user->room);
+			asprintf(&buff, "No topic is set for channel %d.\n", user->room);
 		}
 		display_message(buff, 0, 1);
 		if (topic != NULL) free(topic);
@@ -1088,17 +1088,17 @@ void t_uri(CommandList *cm, int argc, const char **argv, char *args)
 	uriActionList *al = uritable;
 	int wiz=0, num;
 	char c;
-	
+
 	if(argc == 1) {
 		// default action - list last 10 uris
 		uri_list_display(10, NULL);
 		return;
 	}
-	
+
 	if (u_god(user->status))  {
 		wiz=1;
 	}
-		
+
 	while(al->action)
 	{
 		if( strcasecmp(al->action, argv[1]) == 0 // we have a valid action
@@ -1111,17 +1111,17 @@ void t_uri(CommandList *cm, int argc, const char **argv, char *args)
 		}
 		al++;
 	}
-	
+
 	if(argc == 2) // check for the posibility we have ".uri n" (same as .uri list * n)
 	{
 		if(sscanf(argv[1], "%d%c", &num, &c) == 1) { // check the arg is an int
-			if(num > 0) { 
+			if(num > 0) {
 				uri_list_display(num, NULL);
 				return;
 			}
 		}
 	}
-		
+
 	printf("%s\n", cm->ArgError);
 }
 
@@ -1200,13 +1200,13 @@ void set_talk_rights(void)
 	if (cp_flags(user->chatprivs,CP_DEVEL,CM_MODE_ANY)) rights|=0x2000;
 
 	current_rights = RIGHTS_TALK;
-}	
+}
 
-void sendipc(char *to, char *text, int bcast) 
+void sendipc(char *to, char *text, int bcast)
 {
 	int count;
 
-	if (bcast) 
+	if (bcast)
 	{
 		count = ipc_send_to_all(IPC_SCRIPTIPC, text);
 	}
@@ -1226,7 +1226,7 @@ void sendipc(char *to, char *text, int bcast)
 	}
 }
 
-void sendrpc(char *to, char *type, char *text, int bcast) 
+void sendrpc(char *to, char *type, char *text, int bcast)
 {
 	char buff[MAXTEXTLENGTH];
 	int count;
@@ -1234,7 +1234,7 @@ void sendrpc(char *to, char *type, char *text, int bcast)
 	snprintf(buff, MAXTEXTLENGTH, "%s %s", type, text);
 	if(bcast)
 	{
-		count = ipc_send_to_all(IPC_SCRIPTRPC, buff); 
+		count = ipc_send_to_all(IPC_SCRIPTRPC, buff);
 	}
 	else
 	{


=====================================
src/client/talker_privs.c
=====================================
--- a/src/client/talker_privs.c
+++ b/src/client/talker_privs.c
@@ -194,8 +194,8 @@ unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl
 		enter_talker(3);
 	}
 
-	return(new);	
-}	
+	return(new);
+}
 
 
 /***************************/
@@ -212,7 +212,7 @@ char *part_gag_filter(const char *text, int state)
 	 	ptr=0;
 	 	len=strlen(text);
 	}
-	
+
 	while (gaglist[ptr].name!=NULL)
 	{
 	 	if ((len==0 || !strncasecmp(gaglist[ptr].name, text, len)) && strcmp(gaglist[ptr].name, ""))


=====================================
src/client/uri.c
=====================================
--- a/src/client/uri.c
+++ b/src/client/uri.c
@@ -47,7 +47,7 @@ uriFlagList uriflagtable[] = {
 	{ URLFLAG_SUCS, "sucs", "members-only", "(Members Only)" },
 	{ 0, NULL, NULL, NULL }
 };
-	
+
 // turns the db flag string into a bitwise flag field
 static int uri_parse_flags(const char *flagstr)
 {
@@ -108,7 +108,7 @@ static void uri_make_flags_description(char *shortflags, char *flagstr, int len)
 static const char *uri_get_flag_description(int flag)
 {
 	uriFlagList *fl = uriflagtable;
-	
+
 	while(fl->flag)
 	{
 		if(flag == fl->flag)
@@ -123,7 +123,7 @@ static const char *uri_get_flag_description(int flag)
 // display <number> uris posted by <username> (or all users if username is NULL)
 void uri_list_display(int number, const char * username)
 {
-	char *query;	
+	char *query;
 	struct db_result *res;
 	struct db_data *node;
 	int width, i, len;
@@ -131,13 +131,13 @@ void uri_list_display(int number, const char * username)
 	char *mode;
 	int disp_mode=0;
 	char flagstr[1024]="";
-	
+
 	if(username == NULL) {
 		query = sqlite3_mprintf("SELECT id,datetime(added, 'localtime'),user,url,title,flags FROM mwuri ORDER BY id DESC LIMIT %d", number);
 	} else {
 		query = sqlite3_mprintf("SELECT id,datetime(added, 'localtime'),user,url,title,flags FROM mwuri WHERE user=%Q ORDER BY id DESC LIMIT %d", username, number);
 	}
-	res = db_query(MWURI_DB, query, 1);	
+	res = db_query(MWURI_DB, query, 1);
 	fflush(stdout);
 	if(res == NULL) {
 		printf(".uri database lookup failed\n");
@@ -155,11 +155,11 @@ void uri_list_display(int number, const char * username)
 		}
 		else if(res->rows < number)
 		{
-			printf("Displaying all uris posted to milliways%s%s:\n", username ? " by user " : "", username ? username : ""); 
+			printf("Displaying all uris posted to milliways%s%s:\n", username ? " by user " : "", username ? username : "");
 		}
 		else
 		{
-			printf("Displaying the last %d uri%s posted to milliways%s%s:\n", res->rows, res->rows==1? "s":"", username ? " by user " : "", username ? username : ""); 
+			printf("Displaying the last %d uri%s posted to milliways%s%s:\n", res->rows, res->rows==1? "s":"", username ? " by user " : "", username ? username : "");
 		}
 		// pick up the display mode from the private db
 		// we default to short if we don't get anything from the db
@@ -184,10 +184,10 @@ void uri_list_display(int number, const char * username)
 			char *url = node->field[3];
 			char *title = node->field[4];
 			uri_make_flags_description(node->field[5], flagstr, sizeof(flagstr)); // flags = node->field[5]
-			
+
 			snprintf(url_line, width, "#\033G-%s\033-- [%s] <%s>%s\n", id, added, usr, flagstr );
 			display_message(url_line, 0, 1);
-			
+
 			if(title != NULL) {
 				len = strlen(title);
 				for(i = 0; i<len; i++) {
@@ -198,7 +198,7 @@ void uri_list_display(int number, const char * username)
 			{
 				// in full display mode we just show the whole url + title
 				snprintf(url_line, MAXTEXTLENGTH-1, " %s%s%s", url, title ? " | ":"", title ? title:"");
-			
+
 			}
 			else
 			{
@@ -233,8 +233,8 @@ void uri_list(int argc, const char **argv, int wiz)
 	char *username = NULL; // default is to display everyone's uris
 	int number = 10; // default is to display 10 uris
 	struct person *list_user = NULL;
-	char c; 
-	
+	char c;
+
 	if(argc == 1) // just '.uri list'
 	{
 		username = user->name;
@@ -242,10 +242,10 @@ void uri_list(int argc, const char **argv, int wiz)
 	else if(strcasecmp(argv[1], "*") == 0) // wants all uris
 	{
 		// username is already NULL and will thus select everyone
-		if(argc==3) 
+		if(argc==3)
 		{
-			if(sscanf(argv[2], "%d%c", &number, &c) == 1) 
-			{			
+			if(sscanf(argv[2], "%d%c", &number, &c) == 1)
+			{
 				if(number < 1)
 				{
 					printf(".uri list * - can't list <1 uris\n");
@@ -257,22 +257,22 @@ void uri_list(int argc, const char **argv, int wiz)
 				printf(".uri list * - last parameter was not a positive integer\n");
 				return;
 			}
-				
-		}	
+
+		}
 		if(argc>3)
 		{
 			printf(".uri list * - too many parameters\n");
 			return;
 		}
-		
+
 	}
 	else if( (list_user = user_get(argv[1])) != NULL) // is a real user
 	{
 		username = list_user->name;
-		if(argc==3) 
+		if(argc==3)
 		{
-			if(sscanf(argv[2], "%d%c", &number, &c) == 1) 
-			{			
+			if(sscanf(argv[2], "%d%c", &number, &c) == 1)
+			{
 				if(number < 1)
 				{
 					free(list_user);
@@ -293,13 +293,13 @@ void uri_list(int argc, const char **argv, int wiz)
 			printf(".uri list %s - too many parameters\n", argv[1]);
 			return;
 		}
-	} 
+	}
 	else // possibly we have '.uri list n' or we might have garbage
 	{
-		if(argc==2) 
+		if(argc==2)
 		{
-			if(sscanf(argv[1], "%d%c", &number, &c) == 1) 
-			{			
+			if(sscanf(argv[1], "%d%c", &number, &c) == 1)
+			{
 				if(number < 1)
 				{
 					printf(".uri list - can't list <1 uris\n");
@@ -319,11 +319,11 @@ void uri_list(int argc, const char **argv, int wiz)
 			printf(".uri list - invalid parameters\n");
 			return;
 		}
-		
+
 	}
-	
+
 	uri_list_display(number, username);
-	
+
 	if(list_user) {
 		free(list_user);
 	}
@@ -336,9 +336,9 @@ static unsigned int uri_get_id(const char *idstr, int wiz)
 {
 	unsigned int id;
 	char c;
-	char *query;	
+	char *query;
 	struct db_result *res;
-	
+
 	if( strcasecmp( "last", idstr ) == 0)
 	{
 		id=0;
@@ -350,7 +350,7 @@ static unsigned int uri_get_id(const char *idstr, int wiz)
 		{
 			query = sqlite3_mprintf("SELECT id FROM mwuri WHERE user=%Q ORDER BY id DESC LIMIT 1", user->name );
 		}
-		res = db_query(MWURI_DB, query, 0);	
+		res = db_query(MWURI_DB, query, 0);
 		sqlite3_free(query);
 		if(res)
 		{
@@ -378,7 +378,7 @@ static unsigned int uri_get_id(const char *idstr, int wiz)
 void uri_delete(int argc, const char **argv, int wiz)
 {
 	unsigned int id;
-	char *query;	
+	char *query;
 	struct db_result *res;
 	char mesg[MAXTEXTLENGTH];
 	char *del_query;
@@ -386,11 +386,11 @@ void uri_delete(int argc, const char **argv, int wiz)
 	int owner;
 	char answer[10];
 	char *username, *uri, *added;
-	
+
 	if((id = uri_get_id(argv[1], wiz)) > 0 )
 	{
 		query = sqlite3_mprintf("SELECT user,url,added FROM mwuri WHERE id=%d", id);
-		res = db_query(MWURI_DB, query, 1);	
+		res = db_query(MWURI_DB, query, 1);
 		if(res)
 		{
 			if(res->rows > 0)
@@ -399,7 +399,7 @@ void uri_delete(int argc, const char **argv, int wiz)
 				uri = res->data->field[1];
 				added = res->data->field[2];
 				owner = (strcmp(user->name, username)==0);
-				
+
 				if(owner || wiz)
 				{
 					snprintf(mesg, MAXTEXTLENGTH-1, "Are you sure you want to delete %s%s uri %s from mwuri?", owner? "your":username, owner? "":"'s", uri);
@@ -408,8 +408,8 @@ void uri_delete(int argc, const char **argv, int wiz)
 					if (answer[0]=='y' || answer[0]=='Y')
 					{
 						del_query = sqlite3_mprintf("DELETE FROM mwuri WHERE id=%d", id);
-						del_res = db_query(MWURI_DB, del_query, 1);	
-						
+						del_res = db_query(MWURI_DB, del_query, 1);
+
 						if(del_res)
 						{
 							free(del_res);
@@ -455,8 +455,8 @@ void uri_delete(int argc, const char **argv, int wiz)
 static void uri_set_flag(int argc, const char **argv, int wiz, int flag)
 {
 	unsigned int id;
-	char mesg[MAXTEXTLENGTH];	
-	char *query, *update_query;	
+	char mesg[MAXTEXTLENGTH];
+	char *query, *update_query;
 	struct db_result *res, *update_res;
 	int owner;
 	char answer[10];
@@ -464,16 +464,16 @@ static void uri_set_flag(int argc, const char **argv, int wiz, int flag)
 	int flags;
 	char flagstr[1024];
 	const char *desc_str = uri_get_flag_description(flag);
-	
+
 	if(desc_str == NULL) {
 		printf("uri: whoops, someone needs to debug\n");
 		return;
 	}
-	
+
 	if((id = uri_get_id(argv[1], wiz)) > 0 )
 	{
 		query = sqlite3_mprintf("SELECT user,url,flags,datetime(added, 'localtime') FROM mwuri WHERE id=%d", id);
-		res = db_query(MWURI_DB, query, 1);	
+		res = db_query(MWURI_DB, query, 1);
 		if(res)
 		{
 			if(res->rows > 0)
@@ -483,7 +483,7 @@ static void uri_set_flag(int argc, const char **argv, int wiz, int flag)
 				flags = uri_parse_flags(res->data->field[2]);
 				added = res->data->field[3];
 				owner = (strcmp(user->name, username)==0);
-				
+
 				if(owner || wiz)
 				{
 					if(flags & flag)
@@ -499,12 +499,12 @@ static void uri_set_flag(int argc, const char **argv, int wiz, int flag)
 					if (answer[0]=='y' || answer[0]=='Y')
 					{
 						flags ^= flag; // toggle flag
-						
+
 						uri_make_flags_str(flags, flagstr, sizeof(flagstr));
-						
+
 						update_query = sqlite3_mprintf("UPDATE mwuri SET flags=%Q WHERE id=%d", flagstr, id);
-						update_res = db_query(MWURI_DB, update_query, 1);	
-						
+						update_res = db_query(MWURI_DB, update_query, 1);
+
 						if(update_res)
 						{
 							free(update_res);
@@ -539,7 +539,7 @@ static void uri_set_flag(int argc, const char **argv, int wiz, int flag)
 		snprintf(mesg, MAXTEXTLENGTH-1, "uri %s: %s is not a valid uri id", argv[0], argv[1]);
 		display_message(mesg, 0, 1);
 	}
-	
+
 }
 
 // these 3 flag functions call the man set_flag with the right flag
@@ -567,7 +567,7 @@ void uri_display_mode(int argc, const char **argv, int wiz)
 	{
 		mode = default_mode;
 	}
-	
+
 	if(argc == 1)
 	{
 		printf("Current uri list mode is: %s\n", mode ? mode:"short");
@@ -603,7 +603,7 @@ void uri_display_mode(int argc, const char **argv, int wiz)
 			printf("Usage: uri displaymode [full|short]\n");
 		}
 	}
-	
+
 	if(mode != default_mode)
 	{
 		free(mode);
@@ -621,39 +621,39 @@ char *uri_action_tc(const char *text, int state)
 
 	if (state==0)
 	{
-	 	i=0;
-	 	len=strlen(text);
-		wiz = u_god(user->status);		
+		i=0;
+		len=strlen(text);
+		wiz = u_god(user->status);
 	}
-	
+
 	while (uritable[i].action!=NULL)
 	{
-	 	if(len==0 && uritable[i].tc_mode==1)
-	 	{
-	 		// if len is 0 we tc all actions with a tc_mode 1 - tc_mode 2 are the su !edit functions for altering others uris
-	 		do_tc = 1;
-	 	}
-	 	if(len > 0 && (!strncasecmp(uritable[i].action, text, len)) && uritable[i].tc_mode )
-	 	{
-	 		// if we have the first char(s) then all non hidden actions can be shown
-	 		do_tc = 1;
-	 	}
-	 	if(!strcmp(uritable[i].action, ""))
-	 	{	
-	 		do_tc = 0;
-	 	}
-	 	if(uritable[i].needs_wiz && !wiz)
-	 	{
-	 		// if the action needs wiz and we haven't got wiz we don't tc
-	 		do_tc = 0;
-	 	}
-	 	if(do_tc)
-	 	{
-	 	 	c=dupstr(uritable[i].action,"");
-	 	 	i++;
-	 	 	return(c);
-	 	}
-	 	i++;
+		if(len==0 && uritable[i].tc_mode==1)
+		{
+			// if len is 0 we tc all actions with a tc_mode 1 - tc_mode 2 are the su !edit functions for altering others uris
+			do_tc = 1;
+		}
+		if(len > 0 && (!strncasecmp(uritable[i].action, text, len)) && uritable[i].tc_mode )
+		{
+			// if we have the first char(s) then all non hidden actions can be shown
+			do_tc = 1;
+		}
+		if(!strcmp(uritable[i].action, ""))
+		{
+			do_tc = 0;
+		}
+		if(uritable[i].needs_wiz && !wiz)
+		{
+			// if the action needs wiz and we haven't got wiz we don't tc
+			do_tc = 0;
+		}
+		if(do_tc)
+		{
+			c=dupstr(uritable[i].action,"");
+			i++;
+			return(c);
+		}
+		i++;
 	}
 	return(NULL);
 }
@@ -669,13 +669,13 @@ char *uri_arg_tc(const char *text, int state)
 	static int ptr=0;
 	static int len=0;
 	char *c;
-	
+
 	if (state==0)
 	{
 		type = 0;
 		ptr = 0;
 		len = strlen(text);
-		
+
 		if(strcasestr(rl_line_buffer, " list "))
 		{
 			type = 1;
@@ -685,7 +685,7 @@ char *uri_arg_tc(const char *text, int state)
 			type = 2;
 		}
 	}
-	
+
 	if(type == 1)
 	{
 		// tab complete .uri list. part_user function handles it
@@ -704,8 +704,8 @@ char *uri_arg_tc(const char *text, int state)
 			}
 			ptr++;
 		}
-		
+
 	}
 	return(NULL);
 }
-	
+


=====================================
src/client/user.c
=====================================
--- a/src/client/user.c
+++ b/src/client/user.c
@@ -50,7 +50,7 @@ char *getmylogin(void)
 void update_user(struct person *record, int32_t userposn)
 {
 	int outfile;
-	
+
 	outfile=userdb_open(O_RDWR|O_CREAT);
 	/*Lock_File(outfile); */
 	lseek(outfile,userposn,0);
@@ -95,7 +95,7 @@ void strip_name(char *string)
 	char *array;
 	int i,ptr=0;
 	int len;
-	
+
 	len=strlen(string);
 	array=(char *)malloc(len+1);
 	for (i=0;i<len;i++)
@@ -112,7 +112,7 @@ void get_login(char *name, int autochat)
 {
 	char *lname = getmylogin();
 	fflush(stdin);
-gstart:	
+gstart:
 	if (lname == NULL) {
 		/* cant find you, or you are bbs, MUST tell us name */
 		printf(_("Please enter username: "));
@@ -145,7 +145,7 @@ gstart:
 			strncpy(name,lname,NAMESIZE);
 			name[NAMESIZE]=0;
 		}
-	}	
+	}
 }
 
 int get_person(int file, struct person *tmp)
@@ -156,7 +156,7 @@ int get_person(int file, struct person *tmp)
 		return(false);
 	}else
 	if (no<sizeof(*tmp))
-	{	
+	{
 		printf(_("Problem in get_person: my uid=%d my euid=%d"), getuid(), geteuid());
 		perror("userfile");
 		SAFE_FREE(user);
@@ -332,7 +332,7 @@ static int new_usr(struct person *usr, char *name, int32_t *userposn)
 		userdb_write(usr,userposn);
 		return(true);
 	}
-	else return(false);	
+	else return(false);
 }
 
 int is_old(struct person *usr, const char *name, int32_t *userposn)
@@ -351,7 +351,7 @@ int is_old(struct person *usr, const char *name, int32_t *userposn)
 }
 
 void login_ok(struct person *usr, int32_t *userposn, int *autochat)
-{	
+{
 	/* main function */
 	char name[NAMESIZE+1];
 	int okay;
@@ -364,7 +364,7 @@ void login_ok(struct person *usr, int32_t *userposn, int *autochat)
 	}while (!okay);
 }
 
-void list_users(int newonly) 
+void list_users(int newonly)
 {
 	int file;
 	struct person usr;
@@ -372,7 +372,7 @@ void list_users(int newonly)
 	int linecount=0;
 	int screen_height = screen_h();
 	long logout_time;
-		
+
 	file=userdb_open(O_RDONLY);
 	while (get_person(file,&usr))
 	{
@@ -403,7 +403,7 @@ void list_users(int newonly)
 	close(file);
 }
 
-void list_users_since(long date) 
+void list_users_since(long date)
 {
 	int file;
 	struct person usr;
@@ -411,7 +411,7 @@ void list_users_since(long date)
 	int linecount=0;
 	int screen_height = screen_h();
 	long logout_time;
-	
+
 	file=userdb_open(O_RDONLY);
 	while (get_person(file,&usr))
 	{
@@ -453,7 +453,7 @@ static void list_users_flags(int flags, int type, int inv)
 	int check=0;
 	long logout_time;
 	int screen_height=screen_h();
-	
+
 	file=userdb_open(O_RDONLY);
 	while (get_person(file,&usr))
 	{
@@ -485,7 +485,7 @@ static void list_users_flags(int flags, int type, int inv)
 			if (!u_del(usr.status))
 			{
 				linecount++;
-				
+
 				if (type < 3)
 					printf("%*s [%s] [%s] [%s] %s", NAMESIZE, usr.name,
 					  stats, spec, gr, ctime(&logout_time));
@@ -515,7 +515,7 @@ void search(const char *args, const char *ptr)
 	int data;
 	int inv=0;
 	int i;
-	
+
 	if (ptr[0]=='!')
 	{
 		inv=1;


=====================================
src/client/userio.c
=====================================
--- a/src/client/userio.c
+++ b/src/client/userio.c
@@ -78,7 +78,7 @@ void get_str(char *string, int size)
 	else
 	{
 		fflush(stdout);
-		if (mw_fgets(string,size+1,stdin)==NULL || feof(stdin)) 
+		if (mw_fgets(string,size+1,stdin)==NULL || feof(stdin))
 		{
 			eof_caught++;
 			if (eof_caught>=3)
@@ -90,7 +90,7 @@ void get_str(char *string, int size)
 		}else
 			eof_caught=0;
 
-		if ((ptr=(char *)strchr(string,'\n'))!=NULL) 
+		if ((ptr=(char *)strchr(string,'\n'))!=NULL)
 			*ptr=0;
 		else
 		{
@@ -105,7 +105,7 @@ void read2cr(void)
 {
 	int c;
 	while ((c=getachar())!=EOF && c!='\n');
-}	
+}
 
 int getachar(void)
 {


=====================================
src/folders.c
=====================================
--- a/src/folders.c
+++ b/src/folders.c
@@ -41,12 +41,12 @@ void create_folder_file(void)
 {
 	int file,i;
 	struct folder *record;
-	
+
 	record=(struct folder *)malloc(sizeof(*record));
 	record->status=0;
 	file=open(FOLDERFILE,O_WRONLY|O_CREAT,0600);
 	Lock_File(file);
-	for (i=0;i<64;i++) 
+	for (i=0;i<64;i++)
 		if (write(file,record,sizeof(*record))<0)
 		{
 			perror("creating blank folders");
@@ -73,7 +73,7 @@ int foldernumber(const char *name)
 		number++;
 	}while (no!=0 && strncasecmp(name,fold.name,len));
 	close(file);
-	
+
 	if (no==0) return(-1); else return(number-1);
 }
 


=====================================
src/gags.c
=====================================
--- a/src/gags.c
+++ b/src/gags.c
@@ -161,7 +161,7 @@ char * apply_gag(struct person *speaker, const char *text)
 {
 	GagInfo *gi = gaglist;
 
-	/* this never changes at runtime, 
+	/* this never changes at runtime,
 	 * count how many for fast lookups
 	 */
 	if (gag_count == -1) {
@@ -243,7 +243,7 @@ void gag_normal(char *text)
 	while (i<len)
 	{
 		if (text[i]==033) { i+=3; continue; }
-		if (isupper(text[i])) 
+		if (isupper(text[i]))
 			text[i]='M';
 		else
 		if (islower(text[i]))
@@ -409,7 +409,7 @@ static char *duplstr(char *text)
 const char *gag_type(int type)
 {
 	GagInfo *gi = gag_find(type);
-		
+
 	if (gi != NULL) return(gi->text);
 	return("Unknown");
 }
@@ -645,7 +645,7 @@ void gag_ack(char *text)
             do
             {
                 tok = strsep(&p, " \t");
-            
+
                 if(p && *p)
                 {
                     words[i] = tok;
@@ -653,7 +653,7 @@ void gag_ack(char *text)
                 }
             } while((i < MAX_WORDS) && (tok));
         }
-        
+
         /* Convert to martian. */
         {
             char tmp_text[MAXTEXTLENGTH];
@@ -664,39 +664,39 @@ void gag_ack(char *text)
             while((i < MAX_WORDS) && words[i])
             {
                 char tmp_buf[MAXTEXTLENGTH]; /*No good reason to be this big.*/
-                
+
                 if((*words[i]))
-                { 
+                {
                     int word_len;
                     int punctuation;
                     int shouting;
-    
-                    punctuation = shouting = 0;                
-    
+
+                    punctuation = shouting = 0;
+
                     word_len = strlen(words[i]);
                     word_len = (word_len / 4) + 1; /* cheap syllable count */
-    
+
                     if(word_len > (MAXTEXTLENGTH / 6))
                     {
                         word_len = MAXTEXTLENGTH / 6;
                     }
-    
-                    if(strrchr(words[i], '.') || 
+
+                    if(strrchr(words[i], '.') ||
                        strrchr(words[i], ',') ||
                        strrchr(words[i], '!'))
                     {
                         punctuation = 1;
                         word_len++;
                     }
-    
+
                     if(strrchr(words[i], '!') ||
                        (!first && isupper(*(words[i]))))
-                    { 
+                    {
                         shouting = 1;
                     }
-    
+
                     tmp_buf[0] = 0;
-    
+
                     while(word_len)
                     {
                         if(shouting)
@@ -718,19 +718,19 @@ void gag_ack(char *text)
                         word_len--;
                     }
                     strcat(tmp_buf, "! ");
-    
+
                     if(punctuation)
                     {
                         first = 1;
                     }
-    
+
                     /* Crap range check.  Rewrite! */
                     if((strlen(tmp_text) + strlen(tmp_buf)) >= MAXTEXTLENGTH)
                     {
                         break;
                     }
                     else
-                    { 
+                    {
                         strcat(tmp_text, tmp_buf);
                     }
                 }
@@ -796,34 +796,34 @@ char *apply_bork(char *text, const gag_pattern_t *list, int caps)
 #ifdef DEBUG
 printf("Trying rule %d 0x%p '%s' at posn %d  (%c): ",rule,p,p->from,tp,text[tp]);
 #endif
-			
+
 			while (i<l)
 			{
 				if (p->from[i]=='%')
 				{
 					char c;
-	
+
 					if (i==0 && tp!=0) c=text[tp+j-1];
 					else
 						c=text[tp+j];
 
 					if (tp+i==0 || !isalpha(c))
-					{ 
+					{
 #ifdef DEBUG
 						printf("Failed any-char (%c)\n",c);
 #endif
 						break;
 					}
 #ifdef DEBUG
-					else	
+					else
 						printf("%% match i=%d tp=%d j=%d c=%c ",i,tp,j,c);
 #endif
 				}else
 				if (p->from[i]=='^')
 				{
 					if (tp+j!=0 && !isspace(text[tp+j-1])
-						&& !ispunct(text[tp+j-1])) 
-					{ 
+						&& !ispunct(text[tp+j-1]))
+					{
 #ifdef DEBUG
 						printf("Failed ^\n");
 #endif
@@ -832,11 +832,11 @@ printf("Trying rule %d 0x%p '%s' at posn %d  (%c): ",rule,p,p->from,tp,text[tp])
 				}else
 				if (p->from[i]=='$')
 				{
-					 if (tp+j<len && 
+					 if (tp+j<len &&
 						!isspace(text[tp+j]) &&
 						!ispunct(text[tp+j]))
 					{
-#ifdef DEBUG		
+#ifdef DEBUG
 						printf("Failed $\n");
 #endif
 						break;
@@ -845,7 +845,7 @@ printf("Trying rule %d 0x%p '%s' at posn %d  (%c): ",rule,p,p->from,tp,text[tp])
 				if (tolower(p->from[i]) != tolower(text[tp+j]))
 				{
 #ifdef DEBUG
-					printf (" %c != %c\n",p->from[i],text[tp+j]); 
+					printf (" %c != %c\n",p->from[i],text[tp+j]);
 #endif
 					break;
 				}else
@@ -859,7 +859,7 @@ printf("Trying rule %d 0x%p '%s' at posn %d  (%c): ",rule,p,p->from,tp,text[tp])
 */
 
 				/* dont let it overflow */
-				if (bp+strlen(p->to) > MAXTEXTLENGTH-2) 
+				if (bp+strlen(p->to) > MAXTEXTLENGTH-2)
 				{
 #ifdef DEBUG
 					printf("Too Long\n");
@@ -869,7 +869,7 @@ printf("Trying rule %d 0x%p '%s' at posn %d  (%c): ",rule,p,p->from,tp,text[tp])
 				}
 
 				if (j==strlen(p->to))
-				{ /* same length, copy case */ 
+				{ /* same length, copy case */
 #ifdef DEBUG
 	printf("Keep case. j=%d\n",j);
 #endif
@@ -886,9 +886,9 @@ printf("Trying rule %d 0x%p '%s' at posn %d  (%c): ",rule,p,p->from,tp,text[tp])
 					for (i=0;i<j;i++)
 					{ if (isupper(text[tp+i])) cas++; }
 					if (cas==j) /* all upper ? */
-						cas=1; 
+						cas=1;
 					else cas=0;
-			
+
 #ifdef DEBUG
 	printf("Ignore case. j=%d len=%d\n",j,strlen(p->to));
 #endif
@@ -907,7 +907,7 @@ printf("Matched.\n");
 			p++;
 			rule++;
 		}
-		if (p->from==NULL) 
+		if (p->from==NULL)
 		{
 			buff[bp++]=text[tp++];
 #ifdef DEBUG


=====================================
src/gagtable.c
=====================================
--- a/src/gagtable.c
+++ b/src/gagtable.c
@@ -1134,18 +1134,18 @@ const gag_pattern_t nosport[]={
 				 * Campaign */
 { "^cheer leader","pom-pom waver"},
 { "^cheer leading","pom-pom waving"},
-{ "^club$","big stick"}, 
+{ "^club$","big stick"},
 { "^coach$","bus"},
 { "^conversion","algorithm"},
 { "course","smooth"}, /* to get things like racecourse, golf course */
 { "^formula$","recipe"},
 { "^goal","g**l"},
 { "^golfer","fashon victims"},
-{ "^grand prix","great pricks"}, 
+{ "^grand prix","great pricks"},
 { "^grand national","1000 imigrants"},
 { "^hiker","hic-cougher"},
 { "^jockey","j-key"},
-{ "^manager$","p*ss artist"}, 
+{ "^manager$","p*ss artist"},
 { "^mountineer","mole hill climber"},
 { "^olympic$","Greek thingy"},
 { "^olympics$","Greek thingies"},
@@ -1160,7 +1160,7 @@ const gag_pattern_t nosport[]={
 			* caught. */
 { "^referee","w**ker"},
 { "^running$","moving quickly"},
-{ "^sport","sp***"},	
+{ "^sport","sp***"},
 { "^stump","st*mp"},
 { "^tackle$","fishing apparatus"},
 { "^team$","associates"},
@@ -1172,22 +1172,22 @@ const gag_pattern_t nosport[]={
 
 /* sports */
 { "^angling","geometry"},
-{ "^archery$","pointed stick throwing"}, 
+{ "^archery$","pointed stick throwing"},
 { "^athletic$","non-spod"},
-{ "^athletics","running round in circles"},  
+{ "^athletics","running round in circles"},
 { "^badminton","good mint off"},
 { "^boxing$","professional thuggery"},
 { "^cricket$","cri****"},
 { "^cross country","angry city"},
 { "^extra time$","play time"},
-{ "^fencing","walling"}, 
-{ "^fishing","wibbleing"}, 
+{ "^fencing","walling"},
+{ "^fishing","wibbleing"},
 { "^free kick","keep fit"},
 { "^football","foo*****"},
 { "^footie$","foo***"},
 { "^golf$","a good walk ruined"},
 { "^grid iron","steel table"}, /* this is a name for American Football */
-{ "^hiking$","hello Queen"}, 
+{ "^hiking$","hello Queen"},
 { "^hockey","bashing people with big sticks"},
 { "^indy","Native American"}, /* as in indycar racing and the Indy 500 */
 { "^injury$","Doctor Doctor"},
@@ -1197,9 +1197,9 @@ const gag_pattern_t nosport[]={
 { "^motorsport$","driving round in circles"},
 { "^mountineering","mole hill climbing"},
 { "^polo","the mint with the hole"},
-{ "^pool$","puddle"}, 
+{ "^pool$","puddle"},
 { "^racing$","see who is the fastest"},
-{ "^rugby$","a game played by men with funny shaped b*lls"}, 
+{ "^rugby$","a game played by men with funny shaped b*lls"},
 { "^sailing$","boring thing with boats"},
 { "^snooker$","sn**ker"},
 { "^speedway","slow-way"},
@@ -1232,7 +1232,7 @@ const gag_pattern_t nosport[]={
 { "^Birmingham","Brummyport"},
 { "^Cambridge","Cam-shaftbridge"},
 { "^Cardiff","C****ff"},
-{ "^Chelsea","pensioners"}, 
+{ "^Chelsea","pensioners"},
 { "^Cheltenham","Gloucester"},
 { "^Chepstow","Cheap-stow"},
 { "^Essex","EasySex"},
@@ -1242,11 +1242,11 @@ const gag_pattern_t nosport[]={
 { "^Indianapolis","Native American City"},
 { "^Kent","C*nt"},
 { "^Lancashire","Red Rose Land"},
-{ "^Leeds$","Follows"}, 
+{ "^Leeds$","Follows"},
 { "^Liverpool$","Kidneypuddle"},
 { "^Llanelli$","Turks"},
 { "^Lords$","Satan's"},
-{ "^Manchester$","W**kchester"}, 
+{ "^Manchester$","W**kchester"},
 { "^Middlesex$","Transvestite"},
 { "^Newcastle$","Oldfort"},
 { "^Northamptonshire$","North Porktownshite"},
@@ -1261,7 +1261,7 @@ const gag_pattern_t nosport[]={
 { "^Wembley","Chaosville"},
 { "^Wimbledon","Wombleland"},
 { "^Yorkshire","White Rose Land"},
-	
+
 /* Countries & Nationalities.
  * note: please try not to be too offensive here!
  */
@@ -1273,7 +1273,7 @@ const gag_pattern_t nosport[]={
 { "^Irish$","Leprechauns"},
 { "^New Zealand$","Kiwiland"},
 { "^New Zealander","Kiwi"},
-{ "^Scotland$","Thistle"}, 
+{ "^Scotland$","Thistle"},
 { "^Scot$","Angus"},
 { "^Scottish","Anguses"},
 { "^valleys","Ar*e end of nowhere"},


=====================================
src/iconv.c
=====================================
--- a/src/iconv.c
+++ b/src/iconv.c
@@ -18,11 +18,11 @@
 static char * local_charset = NULL;
 
 /**** convert_string_charset ****
-	a generic iconv function to convert a string from any charset to another 
-	expects memory to be allocated for output_buffer 
-   
-	returns: 0 if successful. 
-			 +ve if something was converted but errors occured in the conversion 
+	a generic iconv function to convert a string from any charset to another
+	expects memory to be allocated for output_buffer
+
+	returns: 0 if successful.
+			 +ve if something was converted but errors occured in the conversion
 			 -ve if the conversion fails.
 	input_buffer: pointer to the string you want to convert.
 	input_charset: the iconv encoding description string of the input string
@@ -36,13 +36,13 @@ static char * local_charset = NULL;
 	invalid_count: on invalchars the number of invalid chars that were discovered in the string
 	substitute: if an invalid char is discovered replace it with this ***UTF-8*** string
 					(the utf8 string is converted into your desired charset)
-	
+
 	for sanities sake this function always attempts to put '\0' (in the converted charset)
 	at the end of the output buffer even if there was not a '\0' in the input string.
-	
+
 	it is assumed this function is used on a system that understands UTF-8!
 	if not you will get EOUTPUTNOTSUPPORTED.
-*/	
+*/
 int convert_string_charset(char *input_buffer, const char *input_charset, size_t input_length,
                  char *output_buffer, const char *output_charset, size_t output_buffer_length,
                  size_t *output_bytes_used,  size_t *irreversible_count,
@@ -52,7 +52,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 	char *output_ptr;
 	iconv_t conversion_descriptor;
 	size_t input_bytes_left, output_bytes_left, not_conv_count=0;
-	
+
 	char converted_null[8], null_string[1]="";
 	char *converted_substitute=NULL;
 	size_t converted_substitute_length=output_buffer_length, converted_null_length;
@@ -60,7 +60,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 	int local_invalid_count=0;
 	int i, too_big=0, iconv_failed=0, retval=0;
 	char output_charset_ignore[50];
-	
+
 	if(output_charset==NULL) {
 		return ENOOUTPUTCS;
 	}
@@ -76,7 +76,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 /*	if(input_length<1) {
 		return EZEROLENTGHINPUT;
 	}*/ //thinking about it this isn't really an error.  if you do this you will still get a null string back in your chosen encoding.
-	
+
 	if( strcmp(output_charset,"LOCAL")==0 ) {
 		if(local_charset!=NULL) {
 			output_charset = local_charset;
@@ -89,12 +89,12 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 			output_charset = output_charset_ignore;
 			snprintf(output_charset_ignore, 50, "%s//TRANSLIT", local_charset);
 			output_charset_ignore[49]='\0';
-			
+
 		} else {
 			output_charset = null_string;
 		}
 	}
-	
+
 	if( strcmp(input_charset,"LOCAL")==0 ) {
 		if(local_charset!=NULL) {
 			input_charset = local_charset;
@@ -128,7 +128,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 		iconv_close(conversion_descriptor);
 		return EOUTPUTBUFFMUCHTOOSHORT;
 	}
-	
+
 	/* if the caller specified a invalid char substitute string convert that to the output format */
 	if(substitute!=NULL) {
 		output_bytes_left = sizeof(char) * strlen(substitute) * converted_null_length;
@@ -151,7 +151,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 		converted_substitute_length = (size_t)(output_ptr - converted_substitute);
 	}
 	iconv_close(conversion_descriptor);
-	
+
 	/* open an iconv convertor for the main conversion */
 	conversion_descriptor = iconv_open(output_charset, input_charset);
 	if(conversion_descriptor == (iconv_t)-1) {
@@ -163,13 +163,13 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 			return EOPENCONVERTFAILED;
 		}
 	}
-	
+
 	input_ptr = input_buffer;
 	output_ptr = output_buffer;
 	input_bytes_left = input_length;
 	/* we tell iconv the buffer is shorter than it really is so we always have space to put a null on the end of it */
 	output_bytes_left = output_buffer_length - converted_null_length;
-	
+
 	while(input_bytes_left > 0) {
 		nconv = iconv(conversion_descriptor,
 		              (char **)&input_ptr, &input_bytes_left,
@@ -187,12 +187,12 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 							output_ptr[0]=converted_substitute[i];
 							output_ptr++;
 							output_bytes_left--;
-						} 
+						}
 					} else {
 						too_big=1;
 					}
 				}
-			
+
 			} else if (errno == E2BIG) {
 				/* this happens if the output buffer if not big enough, we truncate to this point but warn the caller */
 				too_big=1;
@@ -204,7 +204,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 				iconv_failed=1;
 				not_conv_count=input_bytes_left;
 				input_bytes_left=0;
-				
+
 			}
 			errno=0;
 		}
@@ -225,19 +225,19 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 	if(too_big) {
 		retval += WOUTPUTTOOSHORT;
 	}
-	
+
 	if(unconverted_bytes!=NULL) {
 		*unconverted_bytes=not_conv_count;
 	}
-	
+
 	if(iconv_failed) {
 		retval += WICONVFAIL;
 	}
-	
+
 	if(output_bytes_used!=NULL) {
 		*output_bytes_used = output_buffer_length - output_bytes_left;
 	}
-	
+
 	if(irreversible_count!=NULL) {
 		if(retval==0) {
 			*irreversible_count=nconv;
@@ -248,7 +248,7 @@ int convert_string_charset(char *input_buffer, const char *input_charset, size_t
 
 	free(converted_substitute);
 	iconv_close(conversion_descriptor);
-	
+
 	return retval;
 }
 
@@ -257,13 +257,13 @@ int utf8_cleanup(char *buff)
 	// useful after various dirty things (snprintf/gags etc.) might have been employed.
 	char *buffcpy;
 	int conversion_result=-1;
-	
+
 	buffcpy=malloc(strlen(buff)+1);
 	if(buffcpy!=NULL)
 	{
 		strcpy(buffcpy, buff);
 		conversion_result=convert_string_charset(buffcpy, "UTF-8", strlen(buffcpy), buff, "UTF-8", strlen(buff)+1, NULL, NULL, NULL, NULL, NULL);
-		free(buffcpy);	
+		free(buffcpy);
 	}
 	return conversion_result;
 }


=====================================
src/ipc.c
=====================================
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -11,7 +11,7 @@
 #include "bb.h"
 
 /* client mode uses this as its connection */
-ipc_connection_t * ipcsock = NULL; 
+ipc_connection_t * ipcsock = NULL;
 char *ipc_parent = NULL;
 
 extern int32_t userposn;
@@ -34,7 +34,7 @@ void ipc_connect(const char *target)
 {
 	const char * host = target;
 
-	if (ipcsock == NULL) 
+	if (ipcsock == NULL)
 		ipcsock = ipcconn_create();
 
 	if (target == NULL) host = ipc_parent;
@@ -138,7 +138,7 @@ unsigned int ipc_send_to_username(const char * dest, enum ipc_types msgtype, con
 		ipcmsg_append(msg, buff, dgram_len);
 		ipcmsg_send(msg, ipcsock);
 	} else {
-		fprintf(stderr, "Failed to utf8_cleanup the message\n"); 
+		fprintf(stderr, "Failed to utf8_cleanup the message\n");
 	}
 	return ret;
 }
@@ -154,7 +154,7 @@ unsigned int ipc_send_to_all(enum ipc_types msgtype, const char * data) {
 }
 
 
-/* 
+/*
  * most of the mw code should use this to send a message object
  * fourcc and destination will control what happens when it
  * gets to the server


=====================================
src/list.h
=====================================
--- a/src/list.h
+++ b/src/list.h
@@ -25,7 +25,7 @@ struct list_head {
 } while (0)
 
 /*
- * Insert a new entry between two known consecutive entries. 
+ * Insert a new entry between two known consecutive entries.
  *
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
@@ -98,7 +98,7 @@ static inline void list_del(struct list_head *entry)
 static inline void list_del_init(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry); 
+	INIT_LIST_HEAD(entry);
 }
 
 /**
@@ -202,7 +202,7 @@ static inline void list_splice_init(struct list_head *list,
 #define list_for_each_prev(pos, head) \
 	for (pos = (head)->prev; pos != (head); \
         	pos = pos->prev)
-        	
+
 /**
  * list_for_each_safe	-	iterate over a list safe against removal of list entry
  * @pos:	the &struct list_head to use as a loop counter.


=====================================
src/perms.c
=====================================
--- a/src/perms.c
+++ b/src/perms.c
@@ -130,7 +130,7 @@ char mesg_stats(char *string, char mstat)
 	else if (mode==1) return(mstat&(~p));
 	else return(p);
 }
-			
+
 char folder_stats(char *string, char st)
 {
 	int mode=0;
@@ -180,7 +180,7 @@ char folder_groups(const char *string, char st)
 	else if (mode==-1) return(st|p);
 	else if (mode==1) return(st&~p);
 	return(p);
-}			
+}
 
 static void show_stats(unsigned char st, char *tmp, size_t tmpsize, const char *map, int flag)
 {
@@ -204,7 +204,7 @@ void show_user_stats(unsigned char ustat, char *tmp, int flag)
 void show_mesg_stats(unsigned char mstat, char *tmp, int flag)
 {
 	int i=0;
-	
+
 	if (mstat&(1<<0)) tmp[i++]='m'; else if (flag) tmp[i++]='-';
 	if (mstat&(1<<1)) tmp[i++]='d'; else if (flag) tmp[i++]='-';
 	if (mstat&(1<<2)) tmp[i++]='r'; else if (flag) tmp[i++]='-';
@@ -216,7 +216,7 @@ void show_fold_stats(char st, char *tmp, int flag)
 {
 	show_stats(st, tmp, MWFOLDR_SIZE, folder_stat_chars, flag);
 }
-	
+
 void show_fold_groups(char st, char *tmp, int flag)
 {
 	int pos = 0;


=====================================
src/server/mwserv.c
=====================================
--- a/src/server/mwserv.c
+++ b/src/server/mwserv.c
@@ -17,7 +17,7 @@ int internet = 0;
 int userposn = 0;
 
 #define MWUSER "mw"
-	
+
 time_t uptime = 0;
 
 struct servopts {


=====================================
src/server/replay.c
=====================================
--- a/src/server/replay.c
+++ b/src/server/replay.c
@@ -56,12 +56,12 @@ void store_message(ipc_message_t *msg)
 	}
 
 	/* only store info/message, not actions */
-	if (msg->head.type <= 26 && 
+	if (msg->head.type <= 26 &&
 	   !( msg->head.type == IPC_TEXT || msg->head.type == IPC_WIZ))
 		return;
 
 	if (store_len >= STORE_SIZE) {
-		/* store is full, discard oldest, 
+		/* store is full, discard oldest,
 		 * it will have wrapped, so store_next is the last one */
 		ipcmsg_destroy(store[store_next]);
 		store_len--;
@@ -115,7 +115,7 @@ void replay(ipc_connection_t *conn, ipc_message_t *msg)
 		int64_t want = json_getint(cmd, "since");
 		while (idx != store_next) {
 			/* list will be in date order */
-			if (store[idx]!=NULL && 
+			if (store[idx]!=NULL &&
 				store[idx]->head.when >= want) break;
 			idx = store_wrap(idx+1);
 		}


=====================================
src/server/servsock.c
=====================================
--- a/src/server/servsock.c
+++ b/src/server/servsock.c
@@ -234,7 +234,7 @@ void write_socket(ipc_connection_t * conn)
 }
 
 extern time_t uptime;
-			
+
 void send_error(ipc_connection_t *conn, ipc_message_t *orig, const char *format, ...) __attribute__((format (printf, 3, 4)));
 
 void send_error(ipc_connection_t *conn, ipc_message_t *orig, const char *format, ...)
@@ -368,7 +368,7 @@ void process_msg(ipc_connection_t *conn, ipc_message_t *msg)
 		json_t * j = json_init(msg);
 		const char * target = json_getstring(j, "target");
 		if (msg_attach_to_username(msg, target) < 1) {
-			send_error(conn, msg, "User '%s' not found", target); 
+			send_error(conn, msg, "User '%s' not found", target);
 		}
 		json_decref(j);
 		ipcmsg_destroy(msg);
@@ -550,7 +550,7 @@ void msg_attach(ipc_message_t *msg, ipc_connection_t *conn)
 	}
 }
 
-/* test if the user is gagged and apply the filter 
+/* test if the user is gagged and apply the filter
  * from - who sent it (to see if they are gagged)
  * msg - the message to filter
  * field - name of json field containing text to filter


=====================================
src/socket.c
=====================================
--- a/src/socket.c
+++ b/src/socket.c
@@ -80,9 +80,9 @@ void ipcmsg_send(ipc_message_t *msg, ipc_connection_t *conn)
 	struct iovec iov[2];
 	int iovused = 0;
 
-	if (conn == NULL) { 
-		//ipcmsg_summary("NO CONN", msg); 
-		return; 
+	if (conn == NULL) {
+		//ipcmsg_summary("NO CONN", msg);
+		return;
 	}
 	if (msg == NULL) { msg_queue(msg, conn); return; }
 	if (conn->fd == -1) { msg_queue(msg, conn); return; }
@@ -181,7 +181,7 @@ int ipcconn_connect(const char * target)
 }
 
 
-/** 
+/**
  * read=1
  * We got an okay to read from this socket/connection
  * make one read and see what we can do with it


=====================================
src/socket.h
=====================================
--- a/src/socket.h
+++ b/src/socket.h
@@ -7,8 +7,8 @@
 
 #define IPCPORT_DEFAULT	9999
 
-/* which userposn is the System user, 
- * 0 is possible but 1 is an impossible location 
+/* which userposn is the System user,
+ * 0 is possible but 1 is an impossible location
  */
 #define SYSTEM_USER 1
 


=====================================
src/special.c
=====================================
--- a/src/special.c
+++ b/src/special.c
@@ -21,7 +21,7 @@ unsigned short set_special(const char *string, unsigned short st)
 			case '+': mode=-1;break;
 			case '-': mode=1;break;
 			case 'C': p=p|(1<<0);break; /* cannot use tell */
-			case 'S': p=p|(1<<1);break; /* su toggle */ 
+			case 'S': p=p|(1<<1);break; /* su toggle */
 			case 'W': p=p|(1<<2);break; /* wiz enabled */
 			case 'n': p=p|(1<<3);break; /* wizchat off */
 			case 'T': p=p|(1<<4);break; /* setable timeout */


=====================================
src/special.h
=====================================
--- a/src/special.h
+++ b/src/special.h
@@ -54,5 +54,5 @@ enum {
 #define s_devel(stat)         (stat & (1<<MWSPCL_DEVEL))
 #define s_fixedcontact(stat)  (stat & (1<<MWSPCL_FIXEDCONTACT))
 #define s_nolinewrap(stat)    (stat & (1<<MWSPCL_NOWRAP))
- 
+
 #endif /* SPECIAL_H */


=====================================
src/str_util.c
=====================================
--- a/src/str_util.c
+++ b/src/str_util.c
@@ -44,7 +44,7 @@ void strip_str(char *string)
 	char *array;
 	int i,ptr=0;
 	int len;
-	
+
 	len=strlen(string);
 	array=(char *)malloc(len+1);
 	for (i=0;i<len;i++)
@@ -78,7 +78,7 @@ void string_add(char **str, const char *fmt, ...)
 	va_start(va, fmt);
 	vasprintf(&text, fmt, va);
 	va_end(va);
-		
+
 	if (*str == NULL)
 	{
 		/* was an empty string, give it this one */
@@ -188,7 +188,7 @@ char *strip_colours(const char *text)
 			k=0;
 			//utf8 safe way to skip the next two chars
 			//we only need this in case someone is mean enough to try using something like
-			// [ESC]r£ as a colour sequence which would previously have us remove the first 
+			// [ESC]r£ as a colour sequence which would previously have us remove the first
 			// byte of the utf8 sequence leaving us with an invalid char.
 			while(i<len && k<2)
 			{


=====================================
src/talker_privs.c
=====================================
--- a/src/talker_privs.c
+++ b/src/talker_privs.c
@@ -6,9 +6,9 @@
 /* chatmode flags, as in currently active modes */
 unsigned long cm_flags(unsigned long cm, unsigned long flags, int mode)
 {
-	if (mode==CM_MODE_CLEAR) return( cm & (~flags) ); 
+	if (mode==CM_MODE_CLEAR) return( cm & (~flags) );
 	else
-	if (mode==CM_MODE_SET) return(cm | flags); 
+	if (mode==CM_MODE_SET) return(cm | flags);
 	else
 	if (mode==CM_MODE_ANY) {
 		return ((cm & flags) > 0);
@@ -22,7 +22,7 @@ unsigned long cm_flags(unsigned long cm, unsigned long flags, int mode)
 char *display_cmflags(unsigned long cm)
 {
 	static char s[40];
-	
+
 	s[0]=0;
 	if (cm & CM_ONCHAT) strcat(s,"c");
 	if (cm & CM_GLOBAL) strcat(s,"o");
@@ -43,7 +43,7 @@ char *display_cmflags(unsigned long cm)
 void show_chatmodes(unsigned long cm, char *tmp, int flag)
 {
 	int i=0;
-	
+
 	if (cm & CM_ONCHAT) tmp[i++]='c'; else if (flag) tmp[i++]='-';
 	if (cm & CM_GLOBAL) tmp[i++]='o'; else if (flag) tmp[i++]='-';
 	if (cm & CM_PROTECTED) tmp[i++]='p'; else if (flag) tmp[i++]='-';
@@ -119,11 +119,11 @@ unsigned long cm_setbycode(unsigned long stat, const char *string)
 
 unsigned long cp_flags(unsigned long cm, unsigned long flags, int mode)
 {
-	if (mode==CM_MODE_SET) return( cm | flags ); 
+	if (mode==CM_MODE_SET) return( cm | flags );
 	else
-	if (mode==CM_MODE_CLEAR) return( cm & (~flags) ); 
+	if (mode==CM_MODE_CLEAR) return( cm & (~flags) );
 	else
-	if (mode==CM_MODE_ANY) { 
+	if (mode==CM_MODE_ANY) {
 		return ((cm & flags) > 0);
 	} else
 	if (mode==CM_MODE_ALL) {
@@ -135,7 +135,7 @@ unsigned long cp_flags(unsigned long cm, unsigned long flags, int mode)
 char *display_cpflags(unsigned long cm)
 {
 	static char s[40];
-	
+
 	s[0]=0;
 	if (cm & CP_CANRAW) strcat(s,"R");
 	if (cm & CP_CANGAG) strcat(s,"G");


=====================================
src/user.c
=====================================
--- a/src/user.c
+++ b/src/user.c
@@ -29,12 +29,12 @@ void userdb_write(struct person *record, int32_t *userposn)
 }
 
 void fetch_user(struct person *record, int32_t userposn)
-{       
+{
         int outfile;
-        
+
         outfile=userdb_open(O_RDWR|O_CREAT);
         lseek(outfile,userposn,0);
         read(outfile,record,sizeof(*record));
         close(outfile);
-}       
+}
 


=====================================
src/user.h
=====================================
--- a/src/user.h
+++ b/src/user.h
@@ -11,12 +11,12 @@
 #define CONTACTSIZE 	60	/* contact address */
 #define DOINGSIZE	79	/* 'doing' user record field */
 
-struct person 
+struct person
 {
 	char name[NAMESIZE+1];
 	char passwd[PASSWDSIZE+1];
 	uint16_t pad0;
-	int32_t lastlogout; 
+	int32_t lastlogout;
 	int32_t folders[2]; /* which folders are subscribed to */
 #define SETALLLONG 0xFFFFFFFF
 	/* person.status


=====================================
src/utils/clean_users.c
=====================================
--- a/src/utils/clean_users.c
+++ b/src/utils/clean_users.c
@@ -2,7 +2,7 @@
 #include <fcntl.h>
 #include "../bb.h"
 int internet=0;
-struct person user; 
+struct person user;
 
 main()
 {
@@ -11,7 +11,7 @@ main()
 	int newfile,oldfile;
 	char buff[20];
 	long tt=0l;
-	
+
 	sprintf(oldpath,"%s/%s",HOMEPATH,USERFILE);
 	sprintf(newpath,"%s.new",oldpath);
 


=====================================
src/utils/del_user.c
=====================================
--- a/src/utils/del_user.c
+++ b/src/utils/del_user.c
@@ -9,14 +9,14 @@
 #include <perms.h>
 
 int internet=0;
-struct person user; 
+struct person user;
 
 int main(void)
 {
 	const char *newpath = USERFILE ".new";
 	int newfile,oldfile;
 	long tt=0l;
-	
+
 	if ((oldfile=open(USERFILE,O_RDONLY))<0)
 	{
 		perror(USERFILE);


=====================================
src/utils/fixuser.c
=====================================
--- a/src/utils/fixuser.c
+++ b/src/utils/fixuser.c
@@ -31,7 +31,7 @@ int main(void)
 		write(ff2, &user, sizeof(user));
 		count++;
 		if (!strcasecmp(user.name, "dot")) {
-			close(ff2); 
+			close(ff2);
 			close(ff);
 			exit(1);
 		}


=====================================
src/utils/sizes.c
=====================================
--- a/src/utils/sizes.c
+++ b/src/utils/sizes.c
@@ -9,7 +9,7 @@
 #include "files.h"
 #include "folders.h"
 
-static void addmap(char *map, const char *name, char key, 
+static void addmap(char *map, const char *name, char key,
 		unsigned long size, void * offset, void * base)
 {
 	int i;
@@ -24,7 +24,7 @@ static void showmap(const char *map, unsigned long size)
 	int i;
 	printf("memmap: ");
 	for (i=0;i<size;i++) {
-		if (map[i]==0) 
+		if (map[i]==0)
 			printf(".");
 		else
 			printf("%c", map[i]);


=====================================
src/webclient/comms.c
=====================================
--- a/src/webclient/comms.c
+++ b/src/webclient/comms.c
@@ -138,7 +138,7 @@ static void accept_pipe_cmd(ipc_message_t *ipc, struct person *mesg_user)
 		whoinfo = strdup(ipc->body);
 		whowhen = time(NULL);
 		/* if we want it, fall through, otherwise stop now */
-		if (whowant != 0) 
+		if (whowant != 0)
 			whowant=0;
 		else
 			return;
@@ -274,7 +274,7 @@ int mainloop(int millis)
 		fwrite(buf, strlen(buf), 1, stderr);
         }
 	if (die) return -1; else
-        if (nfds < 0) return nfds; else 
+        if (nfds < 0) return nfds; else
 		return 0;
 }
 
@@ -412,7 +412,7 @@ static int handle_command(CONNECTION *co)
 		}else{
 			user->room = newroom;
 			snprintf(line, sizeof line, "\03313%s has left to room %d", user->name, newroom);
-			talk_send_to_room(line, oldroom, "raw", -1); 
+			talk_send_to_room(line, oldroom, "raw", -1);
                         snprintf(line, sizeof line, "\03314Leaving room %d for room %d",oldroom,newroom);
                         ipc_send_to_username(user->name,IPC_TEXT,line);
 	                snprintf(line, sizeof line, "\03312%s has just arrived in room %d", user->name, user->room);
@@ -444,7 +444,7 @@ static int handle_command(CONNECTION *co)
                 snprintf(buff, sizeof buff, "{\"status\":\"sayto sent to %s (%s)\"}", duser, msg);
                 send(co->fd, buff, strlen(buff), 0);
 		user->idletime = lastcomm;
-                return 1;			
+                return 1;
 	}else
         if (co->authd && strncasecmp(buff, "emote ", 6)==0) {
 		talk_send_to_room(&buff[6], user->room, "emote", 0);
@@ -469,7 +469,7 @@ static int handle_command(CONNECTION *co)
         }else
 	if (co->authd && strcasecmp(buff, "who")==0) {
 		const char *line = fetch_who(0);
-		if (line != NULL) 
+		if (line != NULL)
 			send(co->fd, line, strlen(line), 0);
 		return 1;
 	}else
@@ -611,7 +611,7 @@ void mwlog(const char *fmt, ...)
 	time_t t;
 
 	va_start(ap, fmt);
-	
+
 	if ((file=open(LOGFILE,O_WRONLY|O_CREAT|O_APPEND,0600))<0)
 	{
 		perror("log");
@@ -638,7 +638,7 @@ int32_t who_find(const char *username)
 	  json_error_t err;
           json_t *wlist = json_loads(whoinfo, 0, &err);
           if (wlist == NULL) return -1;
-  
+
           size_t wi;
           json_t *entry;
           json_array_foreach(wlist, wi, entry) {


=====================================
src/webclient/import.c
=====================================
--- a/src/webclient/import.c
+++ b/src/webclient/import.c
@@ -50,17 +50,17 @@ void update_user(struct person *record, int32_t userposn)
 
 /* chatmode flags, as in currently active modes */
 unsigned long cm_flags(unsigned long cm, unsigned long flags, int mode)
-{       
+{
         if (mode==CM_MODE_CLEAR) return( cm & (~flags) );
-        else    
+        else
         if (mode==CM_MODE_SET) return(cm | flags);
-        else            
+        else
         if (mode==CM_MODE_ANY) {
                 if ((cm&flags)>0) return(true); else return(false);
-        } else  
+        } else
         if (mode==CM_MODE_ALL) {
                 if ((cm&flags)==flags) return(true); else return(false);
-        }               
+        }
         return(0);
 }
 


=====================================
src/webclient/list.h
=====================================
--- a/src/webclient/list.h
+++ b/src/webclient/list.h
@@ -1,8 +1,8 @@
 #ifndef __LIST_H
 #define __LIST_H
 
-/* This file is from Linux Kernel (include/linux/list.h) 
- * and modified by simply removing hardware prefetching of list items. 
+/* This file is from Linux Kernel (include/linux/list.h)
+ * and modified by simply removing hardware prefetching of list items.
  * Here by copyright, credits attributed to wherever they belong.
  * Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu)
  */
@@ -31,7 +31,7 @@ struct list_head {
 } while (0)
 
 /*
- * Insert a new entry between two known consecutive entries. 
+ * Insert a new entry between two known consecutive entries.
  *
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
@@ -104,7 +104,7 @@ static inline void list_del(struct list_head *entry)
 static inline void list_del_init(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry); 
+	INIT_LIST_HEAD(entry);
 }
 
 /**
@@ -205,7 +205,7 @@ static inline void list_splice_init(struct list_head *list,
 #define list_for_each_prev(pos, head) \
 	for (pos = (head)->prev; pos != (head); \
         	pos = pos->prev)
-        	
+
 /**
  * list_for_each_safe	-	iterate over a list safe against removal of list entry
  * @pos:	the &struct list_head to use as a loop counter.


=====================================
src/webclient/mwpoll.c
=====================================
--- a/src/webclient/mwpoll.c
+++ b/src/webclient/mwpoll.c
@@ -37,7 +37,7 @@ static int mydaemon(void)
 	if (pid != 0) {
 		return pid;
 	} else {
-		/* why is this needed ? 
+		/* why is this needed ?
 		if (seteuid(110)) {
 			printf("seteuid failed. %s\n", strerror(errno));
 			exit(0);
@@ -50,7 +50,7 @@ static int mydaemon(void)
 	}
 	return 0;
 }
-			
+
 
 static void usage(const char *name)
 {
@@ -104,7 +104,7 @@ int main(int argc, char ** argv)
 
 
 	/* read the password / session string */
-	{ 
+	{
 		char *p;
 		if (fgets(passwd, sizeof passwd, stdin) == NULL) {
 			printf("Expected password\n");
@@ -216,7 +216,7 @@ int main(int argc, char ** argv)
 		hostname = "localhost";
 	ipc_connect(hostname);
 	open_command_socket();
-	
+
 	if (user->status&(1<<3)) {
 		ipc_close();
 		close_cmd();
@@ -224,7 +224,7 @@ int main(int argc, char ** argv)
 	}
 
 	loggedin = lastcomm = loggedin;
-	
+
 	/* spock, announce us please... */
 	//broadcast_onoffcode(3, 0, user->name, NULL);
 	talk_rawbcast("\03310%s has just joined web talker room %d", user->name, user->room);



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/0513f99657d31d7b60821ab3e85cbc2177393e01
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20151017/6613404b/attachment-0001.html>


More information about the mw-devel mailing list