<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Andrew Price pushed to branch master at <a href="https://projects.sucs.org/arthur/mw">Justin Mitchell / mw</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/bb06aa350b6bd3b24083db5f5d63f2e20865cb82">bb06aa35</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-09T01:26:09Z</i>
</div>
<pre class='commit-message'>Plug some memory leaks
Spotted by scan-build</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/1d4b9ef81d33900950cbab07648c7c43a6b919f0">1d4b9ef8</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-09T01:46:47Z</i>
</div>
<pre class='commit-message'>Rename is_old to user_exists</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/159047914268a888443ed61f23356467c409f87d">15904791</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-09T01:48:46Z</i>
</div>
<pre class='commit-message'>Remove todo.txt
Half of it relates to MUD mode, the other half is out of date.</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/c6cb079d56dad87eb146e74fe81e1d160747176b">c6cb079d</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-09T02:05:29Z</i>
</div>
<pre class='commit-message'>Remove capitalise.awk
sed does it better.</pre>
</li>
</ul>
<h4>16 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
Makefile.common
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
<span class='deleted-file'>
−
capitalise.awk
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
src/client/add.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
src/client/edit.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
src/client/js.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
src/client/main.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
src/client/mesg.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
src/client/mod.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
src/client/newmain.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-9'>
src/client/read.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-10'>
src/client/uri.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-11'>
src/client/user.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-12'>
src/user.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-13'>
src/user.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-14'>
src/webclient/mwpoll.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-15'>
<span class='deleted-file'>
−
todo.txt
</span>
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-0'>
<strong>
Makefile.common
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/Makefile.common
</span><span style="color: #000000;background-color: #ddffdd">+++ b/Makefile.common
</span><span style="color: #aaaaaa">@@ -57,7 +57,7 @@ endif
</span>
# info strings, do not edit.
DEFS:= -DBUILD_DATE=\"$(shell date +%Y%m%d)\"
<span style="color: #000000;background-color: #ffdddd">-DEFS+= -DBUILD_USER=\"$(shell whoami | awk -f $(DEPTH)capitalise.awk)\"
</span><span style="color: #000000;background-color: #ddffdd">+DEFS+= -DBUILD_USER=\"$(shell whoami | sed 's/^./\u&/')\"
</span> DEFS+= -DVER_MAJ=\"$(VERSION_MAJOR)\"
DEFS+= -DVER_MIN=\"$(VERSION_MINOR)\"
DEFS+= -DVER_TWK=\"$(VERSION_TWEAK)\"
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-1'>
<strong>
capitalise.awk
</strong>
deleted
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/capitalise.awk
</span><span style="color: #000000;background-color: #ddffdd">+++ /dev/null
</span><span style="color: #aaaaaa">@@ -1,3 +0,0 @@
</span><span style="color: #000000;background-color: #ffdddd">-{
- print(toupper(substr($1, 1, 1)) substr($1, 2))
-}
</span></code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-2'>
<strong>
src/client/add.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/add.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/add.c
</span><span style="color: #aaaaaa">@@ -197,7 +197,7 @@ int add_msg(int folnum, struct user *user, int replyto)
</span> get_str(new->to,NAMESIZE);
strncpy(t,new->to,NAMESIZE);
strip_name(t);
<span style="color: #000000;background-color: #ffdddd">- if (is_private(fol,user) && !is_old(t, &usr))
</span><span style="color: #000000;background-color: #ddffdd">+ if (is_private(fol,user) && !user_exists(t, &usr))
</span> {
printf(_("Message must be addressed to an existing user.\n"));
free(fol);
<span style="color: #aaaaaa">@@ -217,7 +217,7 @@ int add_msg(int folnum, struct user *user, int replyto)
</span> {
printf(_("Send to: "));
get_str(new->to,SUBJECTSIZE);
<span style="color: #000000;background-color: #ffdddd">- if (is_private(fol,user) && !is_old(new->to, &usr))
</span><span style="color: #000000;background-color: #ddffdd">+ if (is_private(fol,user) && !user_exists(new->to, &usr))
</span> {
printf(_("Message must be addressed to an existing user.\n"));
free(fol);
</code></pre>
<br>
</li>
<li id='diff-3'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-3'>
<strong>
src/client/edit.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/edit.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/edit.c
</span><span style="color: #aaaaaa">@@ -15,6 +15,8 @@
</span> #include <time.h>
#include <stdbool.h>
#include <sys/stat.h>
<span style="color: #000000;background-color: #ddffdd">+
+#include <util.h>
</span> #include "talker_privs.h"
#include "special.h"
#include "incoming.h"
<span style="color: #aaaaaa">@@ -145,7 +147,7 @@ void edit_user(const char *args, const char *name)
</span> struct user u;
struct person *usr = &u.record;
<span style="color: #000000;background-color: #ffdddd">- if (!is_old(name, &u))
</span><span style="color: #000000;background-color: #ddffdd">+ if (!user_exists(name, &u))
</span> {
printf(_("Username %s not found.\n"),name);
return;
<span style="color: #aaaaaa">@@ -411,7 +413,7 @@ void edit_user(const char *args, const char *name)
</span> char answer[10];
struct user uu;
<span style="color: #000000;background-color: #ffdddd">- if (is_old(username, &uu))
</span><span style="color: #000000;background-color: #ddffdd">+ if (user_exists(username, &uu))
</span> {
/* it exists, so is it the right person */
if (u.posn != uu.posn)
<span style="color: #aaaaaa">@@ -774,7 +776,7 @@ void mesg_edit(const char *args, struct folder *folder, int msgno, struct user *
</span> {
int fd, text;
struct Header head;
<span style="color: #000000;background-color: #ffdddd">- char *buff;
</span><span style="color: #000000;background-color: #ddffdd">+ _autofree char *buff = NULL;
</span>
fd = open_folder_index(folder, FOL_LIVE, O_RDWR, 0);
if (fd < 0)
<span style="color: #aaaaaa">@@ -936,7 +938,6 @@ void mesg_edit(const char *args, struct folder *folder, int msgno, struct user *
</span> Unlock_File(fd);
close(fd);
close(text);
<span style="color: #000000;background-color: #ffdddd">- free(buff);
</span> }
void time_on(long u)
</code></pre>
<br>
</li>
<li id='diff-4'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-4'>
<strong>
src/client/js.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/js.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/js.c
</span><span style="color: #aaaaaa">@@ -288,8 +288,8 @@ static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp)
</span> size_t ucs2_length, prompt_length, line_length;
const jschar *ucs2_string;
int conv_error;
<span style="color: #000000;background-color: #ffdddd">-
- char *prompt=NULL, *line;
</span><span style="color: #000000;background-color: #ddffdd">+ _autofree char *prompt = NULL;
+ _autofree char *line = NULL;
</span>
if(argc > 0) {
if(JSVAL_IS_STRING(argv[0])) {
<span style="color: #aaaaaa">@@ -303,8 +303,6 @@ static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp)
</span> 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) {
fprintf(stderr, "js_input: convert_string_charset failed with error: %d\n", conv_error);
<span style="color: #000000;background-color: #ffdddd">- free(prompt);
- prompt=NULL;
</span> }
}
} else {
<span style="color: #aaaaaa">@@ -322,8 +320,6 @@ static JSBool js_input(JSContext *cx, unsigned int argc, jsval *vp)
</span> js_start_timeout();
busy--;
<span style="color: #000000;background-color: #ffdddd">- free(prompt);
-
</span> line_length = sizeof(jschar) * (strlen(line) + 1);
// likewise as this has come straight from a readline we need a convert from local charset
</code></pre>
<br>
</li>
<li id='diff-5'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-5'>
<strong>
src/client/main.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/main.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/main.c
</span><span style="color: #aaaaaa">@@ -468,7 +468,7 @@ int main(int argc, char **argv)
</span> b=(char *)getmylogin();
if (b!=NULL)
{
<span style="color: #000000;background-color: #ffdddd">- if (is_old(b, user))
</span><span style="color: #000000;background-color: #ddffdd">+ if (user_exists(b, user))
</span> list_new_items(user,true);
}else
printf(_("Username not permitted.\n"));
<span style="color: #aaaaaa">@@ -480,7 +480,7 @@ int main(int argc, char **argv)
</span> if (b!=NULL)
{
/* try and load user - if ok, view since info */
<span style="color: #000000;background-color: #ffdddd">- if (is_old(b, user))
</span><span style="color: #000000;background-color: #ddffdd">+ if (user_exists(b, user))
</span> {
/* view since */
list_users_since(user->record.lastlogout);
<span style="color: #aaaaaa">@@ -536,7 +536,7 @@ int main(int argc, char **argv)
</span> {
const char *name = argv[msguser_num];
<span style="color: #000000;background-color: #ffdddd">- if (!is_old(name, user))
</span><span style="color: #000000;background-color: #ddffdd">+ if (!user_exists(name, user))
</span> {
fprintf(stderr,_("%s: User %s not found.\n"), argv[0], name);
exit(-1);
<span style="color: #aaaaaa">@@ -559,7 +559,7 @@ int main(int argc, char **argv)
</span> fprintf(stderr,_("%s: Folder %s not found.\n"), argv[0], foldname);
exit(-1);
}
<span style="color: #000000;background-color: #ffdddd">- if (!is_old(folduser, user))
</span><span style="color: #000000;background-color: #ddffdd">+ if (!user_exists(folduser, user))
</span> {
fprintf(stderr,_("%s: User %s not found.\n"), argv[0], folduser);
exit(-1);
</code></pre>
<br>
</li>
<li id='diff-6'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-6'>
<strong>
src/client/mesg.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/mesg.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/mesg.c
</span><span style="color: #aaaaaa">@@ -5,6 +5,8 @@
</span> #include <unistd.h>
#include <string.h>
#include <stdarg.h>
<span style="color: #000000;background-color: #ddffdd">+
+#include <util.h>
</span> #include "talker_privs.h"
#include "special.h"
#include "ipc.h"
<span style="color: #aaaaaa">@@ -19,16 +21,18 @@ extern struct user * const user;
</span> void send_mesg(char *from, const char *to, char *text, int wiz)
{
char buff[MAXTEXTLENGTH];
<span style="color: #000000;background-color: #ffdddd">- struct user *usr;
</span><span style="color: #000000;background-color: #ddffdd">+ _autofree struct user *usr = calloc(1, sizeof(*usr));
</span>
<span style="color: #000000;background-color: #ffdddd">- usr = user_get(to);
- if (! usr) {
</span><span style="color: #000000;background-color: #ddffdd">+ if (usr == NULL) {
+ perror("calloc");
+ return;
+ }
+ if (!user_exists(to, usr)) {
</span> printf(_("User does not exist.\n"));
return;
}
if (! u_reg(usr)) {
printf(_("%s is not registered.\n"),to);
<span style="color: #000000;background-color: #ffdddd">- free(usr);
</span> return;
}
if (u_mesg(usr)) {
<span style="color: #aaaaaa">@@ -36,12 +40,9 @@ void send_mesg(char *from, const char *to, char *text, int wiz)
</span> printf(_("%s has msg off, writing anyway.\n"),to);
} else {
printf(_("%s has turned messages off.\n"),to);
<span style="color: #000000;background-color: #ffdddd">- free(usr);
</span> return;
}
}
<span style="color: #000000;background-color: #ffdddd">- free(usr);
-
</span> snprintf(buff, MAXTEXTLENGTH, "*** %s: %s", from, text);
if (ipc_send_to_username(to, IPC_WIZ, buff) <= 0) {
printf(_("User not logged on.\n"));
</code></pre>
<br>
</li>
<li id='diff-7'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-7'>
<strong>
src/client/mod.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/mod.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/mod.c
</span><span style="color: #aaaaaa">@@ -118,6 +118,7 @@ void moderate(void)
</span> if ((foo=read(tmptext,text,head.size))<head.size)
{
printf(_("only %d of %d bytes read.\n"),foo,head.size);
<span style="color: #000000;background-color: #ddffdd">+ free(text);
</span> return;
}
display_article(&head,tmptext);
</code></pre>
<br>
</li>
<li id='diff-8'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-8'>
<strong>
src/client/newmain.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/newmain.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/newmain.c
</span><span style="color: #aaaaaa">@@ -575,8 +575,6 @@ void c_topten(CommandList *cm, int argc, const char **argv, char *args)
</span> {
struct listing *head=NULL;
struct Header hdr;
<span style="color: #000000;background-color: #ffdddd">- struct listing *lnew;
- struct listing *ptr;
</span> struct folder folder;
int file;
int count;
<span style="color: #aaaaaa">@@ -594,7 +592,7 @@ void c_topten(CommandList *cm, int argc, const char **argv, char *args)
</span>
if ((file = open_folder_index(&folder, FOL_LIVE, O_RDONLY, 0)) < 0)
return;
<span style="color: #000000;background-color: #ffdddd">- lnew=(struct listing *)malloc(sizeof(*lnew));
</span><span style="color: #000000;background-color: #ddffdd">+
</span> while(read(file,&hdr,sizeof(hdr))>0)
{
struct listing *listing = head;
<span style="color: #aaaaaa">@@ -608,12 +606,12 @@ void c_topten(CommandList *cm, int argc, const char **argv, char *args)
</span> }
else
{
<span style="color: #000000;background-color: #ddffdd">+ struct listing *lnew = calloc(1, sizeof(*lnew));
</span> strcpy(lnew->name,hdr.from);
lnew->count=1;
lnew->size=hdr.size;
lnew->next=head;
head=lnew;
<span style="color: #000000;background-color: #ffdddd">- lnew=(struct listing *)malloc(sizeof(*lnew));
</span> }
}
head=Sort(head);
<span style="color: #aaaaaa">@@ -621,12 +619,13 @@ void c_topten(CommandList *cm, int argc, const char **argv, char *args)
</span> printf("Top posters in folder %s\n", folder.name);
printf("In order of Total size of text posted.\n");
<span style="color: #000000;background-color: #ffdddd">- ptr=head;
</span> count=2;
<span style="color: #000000;background-color: #ffdddd">- while (ptr!=NULL)
</span><span style="color: #000000;background-color: #ddffdd">+ while (head != NULL)
</span> {
<span style="color: #000000;background-color: #ffdddd">- printf("Name: %*s %3d Msgs. %5d bytes (%2.1fK)\n",NAMESIZE,ptr->name,ptr->count,ptr->size,ptr->size/1024.0);
- ptr=ptr->next;
</span><span style="color: #000000;background-color: #ddffdd">+ struct listing *l;
+
+ printf("Name: %*s %3d Msgs. %5d bytes (%2.1fK)\n", NAMESIZE, head->name,
+ head->count, head->size, head->size/1024.0);
</span> count++;
if (count>=screen_height-2)
{
<span style="color: #aaaaaa">@@ -636,6 +635,9 @@ void c_topten(CommandList *cm, int argc, const char **argv, char *args)
</span> if (*buff=='q' || *buff=='Q') exit(0);
count=0;
}
<span style="color: #000000;background-color: #ddffdd">+ l = head;
+ head = head->next;
+ free(l);
</span> }
}
</code></pre>
<br>
</li>
<li id='diff-9'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-9'>
<strong>
src/client/read.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/read.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/read.c
</span><span style="color: #aaaaaa">@@ -74,6 +74,7 @@ void display_article(struct Header *tmp, int datafile)
</span> {
printf("Failed to read entire data entry");
perror("read data");
<span style="color: #000000;background-color: #ddffdd">+ free(buff);
</span> return;
}
if (!remote)
</code></pre>
<br>
</li>
<li id='diff-10'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-10'>
<strong>
src/client/uri.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/uri.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/uri.c
</span><span style="color: #aaaaaa">@@ -5,6 +5,7 @@
</span> #include <readline/readline.h>
#include <sqlite.h>
<span style="color: #000000;background-color: #ddffdd">+#include <util.h>
</span> #include "uri.h"
#include "sqlite.h"
#include "talker.h"
<span style="color: #aaaaaa">@@ -232,9 +233,13 @@ void uri_list(int argc, const char **argv, int wiz)
</span> {
char *username = NULL; // default is to display everyone's uris
int number = 10; // default is to display 10 uris
<span style="color: #000000;background-color: #ffdddd">- struct user *list_user = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+ _autofree struct user *list_user = calloc(1, sizeof(*list_user));
</span> char c;
<span style="color: #000000;background-color: #ddffdd">+ if (list_user == NULL) {
+ perror("calloc");
+ return;
+ }
</span> if(argc == 1) // just '.uri list'
{
username = user->record.name;
<span style="color: #aaaaaa">@@ -266,7 +271,7 @@ void uri_list(int argc, const char **argv, int wiz)
</span> }
}
<span style="color: #000000;background-color: #ffdddd">- else if( (list_user = user_get(argv[1])) != NULL) // is a real user
</span><span style="color: #000000;background-color: #ddffdd">+ else if (user_exists(argv[1], list_user))
</span> {
username = list_user->record.name;
if(argc==3)
<span style="color: #aaaaaa">@@ -275,21 +280,18 @@ void uri_list(int argc, const char **argv, int wiz)
</span> {
if(number < 1)
{
<span style="color: #000000;background-color: #ffdddd">- free(list_user);
</span> printf(".uri list %s - can't list <1 uris\n", argv[1]);
return;
}
}
else
{
<span style="color: #000000;background-color: #ffdddd">- free(list_user);
</span> printf(".uri list %s - last parameter was not a positive integer\n", argv[1]);
return;
}
}
if(argc>3)
{
<span style="color: #000000;background-color: #ffdddd">- free(list_user);
</span> printf(".uri list %s - too many parameters\n", argv[1]);
return;
}
<span style="color: #aaaaaa">@@ -323,10 +325,6 @@ void uri_list(int argc, const char **argv, int wiz)
</span> }
uri_list_display(number, username);
<span style="color: #000000;background-color: #ffdddd">-
- if(list_user) {
- free(list_user);
- }
</span> }
// checks an id supplied to uri_delete/nsfw etc. is valid or creates an id if the user specified 'last'
</code></pre>
<br>
</li>
<li id='diff-11'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-11'>
<strong>
src/client/user.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/user.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/user.c
</span><span style="color: #aaaaaa">@@ -301,7 +301,7 @@ void login_ok(struct user *usr, int *autochat)
</span> int okay;
do{
get_login(name, *autochat);
<span style="color: #000000;background-color: #ffdddd">- if(is_old(name, usr))
</span><span style="color: #000000;background-color: #ddffdd">+ if(user_exists(name, usr))
</span> okay=old_usr(usr);
else
okay=new_usr(name, usr);
</code></pre>
<br>
</li>
<li id='diff-12'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-12'>
<strong>
src/user.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/user.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/user.c
</span><span style="color: #aaaaaa">@@ -132,23 +132,9 @@ static int user_find_name(const char *name, struct user *user, int *found)
</span> return 0;
}
<span style="color: #000000;background-color: #ffdddd">-int is_old(const char *name, struct user *usr)
</span><span style="color: #000000;background-color: #ddffdd">+int user_exists(const char *name, struct user *usr)
</span> {
int found;
return !user_find_name(name, usr, &found) && found;
}
<span style="color: #000000;background-color: #ffdddd">-
-/*
- * Get the user DB record for a named user
- * Returns a malloc()ed record, or NULL on error.
- */
-struct user *user_get(const char *name)
-{
- struct user *usr;
-
- usr = calloc(1, sizeof(*usr));
- if (usr != NULL && is_old(name, usr))
- return usr;
- return NULL;
-}
</span></code></pre>
<br>
</li>
<li id='diff-13'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-13'>
<strong>
src/user.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/user.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/user.h
</span><span style="color: #aaaaaa">@@ -85,8 +85,7 @@ extern int fetch_first_user(int fd, struct user *user);
</span> extern int fetch_next_user(int fd, struct user *user);
extern void update_user(struct user *user);
extern int update_user_fd(int fd, struct user *user);
<span style="color: #000000;background-color: #ffdddd">-extern int is_old(const char *name, struct user *user);
-extern struct user* user_get(const char *name);
</span><span style="color: #000000;background-color: #ddffdd">+extern int user_exists(const char *name, struct user *user);
</span>
#define for_each_user(userp, fd, status) \
for((status) = fetch_first_user((fd), (userp)); \
</code></pre>
<br>
</li>
<li id='diff-14'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-14'>
<strong>
src/webclient/mwpoll.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/webclient/mwpoll.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/webclient/mwpoll.c
</span><span style="color: #aaaaaa">@@ -125,10 +125,8 @@ int main(int argc, char ** argv)
</span> if ((p=strchr(rawpw,'\n'))!=NULL) *p=0;
}
<span style="color: #000000;background-color: #ffdddd">- /* fetch the user record */
- if (!is_old(username, user)) {
</span><span style="color: #000000;background-color: #ddffdd">+ if (!user_exists(username, user)) {
</span> if (autocreate) {
<span style="color: #000000;background-color: #ffdddd">- /* user doesnt exist, create them */
</span> create_user(user, username, rawpw);
} else {
printf("User '%s' not found.\n", username);
</code></pre>
<br>
</li>
<li id='diff-15'>
<a href='https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b#diff-15'>
<strong>
todo.txt
</strong>
deleted
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/todo.txt
</span><span style="color: #000000;background-color: #ddffdd">+++ /dev/null
</span><span style="color: #aaaaaa">@@ -1,131 +0,0 @@
</span><span style="color: #000000;background-color: #ffdddd">-=================
-== BUGS/NEEDED ==
-=================
-
-
- Rooms
- ------
-
-
- Code
- -----
-
-
- Help
- -----
-
-
-
-===========
-== IDEAS ==
-===========
-
-
- Rooms
- ------
-
- - If anyone wishes to start, there are some links for new areas around:
-
- * 614: Tunnel down to the sea. needs a nice half-way room with a stream
- and quartz roof - for reference material see the Ulgo caves in the
- Belgariad by David Eddings :)
-
- * 21: Path around the south of the manor, heads over downlands to the
- sea cliffs - plan to do a nice walk here, beaches, a path down,
- and some form of link to the above tunnel
-
- * 1026: Hidden path behind waterfall would be nice. perhaps linking up
- to the smugglers tunnel, and catacombs below cmc's house
-
- * 410: Catacombs below cmc's house
-
- * 442: Continue the lane northwards
-
- * 37: The Gatehouse/Lodge
-
- * 470: The hole
-
- * 422: Continue the lane southwards
-
- * 20: The wall, lawn etc.. all need doing
-
- * 6000: Perhaps more on the milliways universe?
-
- - There needs to be some catacombs system designed - would be nice to have
- everything turn you around so you have to use left, right, forwards and
- backwards, and depending on the direction you just came from these mean
- different things - AKA the Discworld MUD UU Library.
-
- - The beaches, cliffs, and downlands all need designing, with maybe a
- lighthouse, boathouse, and even the ability to sail elsewhere.
-
-
-
- Code
- -----
-
- - Add 'option lists' for extra tab-completion styles in scripts:
- Allow to be added using 'binds' in .mwrc
- Eg:
- option-list bw black white
- defines keyword 'bw' to contain 'black' and 'white'
- option-list uname [usernames] dom
- defines keyword 'uname' to be the list 'usernames' + 'dom'
-
- - Add 'useralias' to check for alternative usernames
- * add command 'useralias <username> <new alias>'
- - this will not allow you to create an alias of a username
- that doesnt exist
- - this will not allow you to create an alias that is the
- same as a user that already exists
- - any useralias checks that fail will remove themselves from
- the useralias list (ie, user has been deleted)
- add command 'removeuseralias <alias>'
- - this will not allow you to unalias an alias that does not
- exist
- * add alias listings to the end of 'part_who' (main.c)
- * add alias listings to the end of 'part_who_talk' (main.c)
- * add alias check to line 672 of script_inst.c in user ignore test
- (ie, if cant find user, check for user alias first, and try again)
- * add alias check to line 1544 of script_inst.c in 'ison' user check
- (ie, if is_old fails, check for alias and is_old that too)
- * add alias check to line 813 of talker.c, in 't_ignore' user check
- (ie, if is_old fails, check for alias and is_old that too)
- * add alias check for unignore, and qunignore in talker.c and
- script_inst.c respectively (see previous lines for ignores)
- * add alias check to line 1699 of talker.c (talk_sendto) in
- username stricmp. (+lines 1705, 1708)
- * same for talk_single, sendipc and sendrpc in talker.c
- * same for 'get_pid' and 'get_user_pid' in who.c
- * arg.. and in all the other places where usernames are used
-
- *****************************************************************
- *** COME UP WITH A FUNCTION THAT WILL CHANGE TEXT TO AN ALIAS ***
- *** eg, 'CheckUserName(char *szInput, char *szOutput)' ***
- *** will return the aliased name, or if not found, the same ***
- *** name in output. therefore, any username checks just need ***
- *** to run this at the beginning!!! :) ***
- *****************************************************************
-
- - Text output preprocessing - need to run a script from any send routine
- (such as sayto, talk etc...)
- * 'outputevent' script command to bind an output event function
- * any outputevent function can use 'SAY' etc.. to send text out
- * use 'OUTPUT OFF' to suppress normal sending of text
- * will only be able to work on normal talker output - not RAW, SAYTO etc..
- * MUST BE ABLE TO STOP CONSTANT REDIRECTION WITH SCRIPTS. ie, if a script
- uses a SAY, then that SAY must *not* be handled by the output script
- or infinite loops will occur
-
- - Get '!user timeout <user>' to automatically set the special 'T' flag
- too? This needs discussion, because currently this allows for
- current-process timeout changes, without it being persistent.
-
- - Need to add 'time events' to MUD. eg, "Someone walks past whistling",
- "You hear some church bells ring XXX o'clock", and "It begins to snow".
- These would obviously have to be room/distance dependant.
-
-
- Help
- -----
-
</span></code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b">View it on GitLab</a>
<br>
You're receiving this email because of your account on <a href="https://projects.sucs.org/">projects.sucs.org</a>.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":["merge_requests","issues","commit"],"url":"https://projects.sucs.org/arthur/mw/compare/a4e857931e30b695efe0ed2fa85934c19d6d9e8d...c6cb079d56dad87eb146e74fe81e1d160747176b"}}</script>
</p>
</div>
</body>
</html>