<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/0292a1e669744550879890b29a098034af5146fb">0292a1e6</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T00:51:48Z</i>
</div>
<pre class='commit-message'>Replace get_person with thread-safe iterator-style functions</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/15f92520d70953aa7db83934ec2d2895e5dee62a">15f92520</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T01:07:43Z</i>
</div>
<pre class='commit-message'>Operate on a struct user in {get,set}_subscribe()</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/31afed912e187190ba4de7e988910649a79fa3e1">31afed91</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T01:32:01Z</i>
</div>
<pre class='commit-message'>Remove now-unused err_open()</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/8078c2181b7f07182a5c70c288afa816fb9f90c4">8078c218</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T02:49:03Z</i>
</div>
<pre class='commit-message'>Remove some bits related to force</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/7a2345192db78843fd1859eef6345bfa8d975865">7a234519</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T03:08:56Z</i>
</div>
<pre class='commit-message'>Move loggedin into struct user</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/14623ddcc13b1c60102fd147ca6acb75f1bb2f00">14623ddc</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T04:47:50Z</i>
</div>
<pre class='commit-message'>Fix part_user()

Don't start at the beginning of the user db each time.</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/db46c1500d4179cb34b8e6cdb200ffbc1aebaa57">db46c150</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T05:31:25Z</i>
</div>
<pre class='commit-message'>Remove the 'unforceable' bit filter from commands

And tidy up command.c a bit</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/8ef4e0739667dc15206aeef6fbb815bb35983f94">8ef4e073</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T05:32:17Z</i>
</div>
<pre class='commit-message'>Move the global 'fold' variable into struct user</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/1e64c155cecd11bba956301d4dc61ef22b584cb0">1e64c155</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T06:27:40Z</i>
</div>
<pre class='commit-message'>Put the client's global user on the stack

Make it static but add a convenience pointer to it to take the place of
the previous user pointer. Make the pointer itself const so that the
compiler complains if anything besides the original user's address is
assigned to it.</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/d881fc863cfee125b72b8c07e89090b7a4dceeb6">d881fc86</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T07:24:21Z</i>
</div>
<pre class='commit-message'>Make the autofree stuff more generic

(And less shouty.)</pre>
</li>
</ul>
<h4>35 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/client/Parse.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
src/client/colour.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
src/client/command.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/folders.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
src/client/incoming.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
src/client/init.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
src/client/js.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
src/client/log.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-9'>
src/client/main.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-10'>
src/client/mesg.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-11'>
src/client/new.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-12'>
src/client/newmain.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-13'>
src/client/script.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-14'>
src/client/script_inst.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-15'>
src/client/strings.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-16'>
src/client/strings.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-17'>
src/client/talker.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-18'>
src/client/talker_privs.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-19'>
src/client/uri.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-20'>
src/client/user.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-21'>
src/client/user.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-22'>
src/client/who.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-23'>
src/folders.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-24'>
src/perms.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-25'>
src/perms.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-26'>
src/server/actions.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-27'>
src/server/mwserv.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-28'>
src/server/servsock.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-29'>
src/socket.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-30'>
src/user.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-31'>
src/user.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-32'>
src/util.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-33'>
src/webclient/comms.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-34'>
src/webclient/import.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-0'>
<strong>
src/client/Parse.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/Parse.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/Parse.c
</span><span style="color: #aaaaaa">@@ -11,7 +11,7 @@
</span> 
 extern unsigned long rights;
 extern CommandList chattable[];
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 #include "alias.h"
 extern Alias alias_list;
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-1'>
<strong>
src/client/colour.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/colour.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/colour.c
</span><span style="color: #aaaaaa">@@ -20,7 +20,7 @@ static  char *colour_chart[COLOUR_LIMIT];
</span> static char *colour_set=NULL;
 
 /* the current user template */
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 /* return colour code sequence */
 char *colour(char *text, int *concealed)
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-2'>
<strong>
src/client/command.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/command.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/command.c
</span><span style="color: #aaaaaa">@@ -2,88 +2,86 @@
</span> #include "talker.h"
 
 /*
<span style="color: #000000;background-color: #ffdddd">-        0x001 - superuser,      (1)
-       0x002 - Wizchat,        (2)
</span><span style="color: #000000;background-color: #ddffdd">+   0x001 - superuser,      (1)
+       0x002 - Wizchat,        (2)
</span>   0x004 - Special Wizard, (4)
<span style="color: #000000;background-color: #ffdddd">-        0x008 - Moderator,      (8)
-       0x010 - On Machine      (16)
-       0x020 - registered      (32)
-       0x040 - Timeout         (64)
-       0x080 - force           (128)   - Obsolete
-       0x100 - unforceable     (256)   - Obsolete
</span><span style="color: #000000;background-color: #ddffdd">+   0x008 - Moderator,      (8)
+       0x010 - On Machine      (16)
+       0x020 - registered      (32)
+       0x040 - Timeout         (64)
</span> */
 
 CommandList table[]={
<span style="color: #000000;background-color: #ffdddd">-{"addfol",    0x101,  0, "Usage: addfol", "Create a folder", c_addfol, 1},
-{"alias",    0x100,  2, "Usage: alias <alias> <command>", "Add the alias to the current session", c_alias, 1},
-{"autosub",          0x101,  2, "Usage: autosub <folder> <yes | no>", "Force everyone's subscription to <folder>", c_autosub, 1},
-{"backward",         0x000,  0, "Usage: backward", "Display preceeding message", c_prev, 1},
-{"beep",     0x000,  1, "Usage: beep <on | off>", "Toggle audible beeps", c_beep, 1},
-{"board",    0x101,  1, "Usage: board [un]lock", "[un]lock the bbs to normal users", c_board, 1},
-{"catchup",          0x000,  0, "Usage: catchup <folder | all>", "Mark this or selected folder as read", c_catchup, 1},
-{"cd",       0x000,  1, "Usage: cd <folder>", "Change to a folder", c_cd, 1},
-{"changeinfo",       0x001,  1, "Usage: changeinfo <on|off>", "Toggle user status change messages", c_changeinfo, 1},
-{"charset",  0x000,  0, "Usage: charset <charset>", "Change character set", c_charset, 1},
-{"chat",     0x020,  0, "Usage: chat", "Enter chat mode", c_chatmode, 1},
-{"colour",           0x000,  0, "Usage: colour <on | off | list | n>", "Colour mode options", c_colouroff, 1},
-{"contact",  0x120,  0, "Usage: contact", "Changes your contact address", c_contact, 1},
-{"credits",          0x000,  0, "Usage: credits", "Display the credits", c_credits, 1},
-{"date",     0x000,  0, "Usage: date", "Display the current system date", c_date, 1},
-{"doing",    0x000,  0, "Usage: doing <message>", "Set <doing> field of who", c_doing, 1},                   /* privs were 0x001 */
-{"emote",    0x002,  1, "Usage: emote <message>", "Send emotion to all wizchat users",c_emote, 1},
-{"first",    0x000,  0, "Usage: first", "Display first message in current folder", c_first, 1},
-{"folder",   0x101,  2, "Usage: folder <com> <name>", "Folder editing functions", c_folder, 1},
-{"forward",          0x000,  0, "Usage: forward", "Display following message", c_next, 1},
-{"help",     0x000,  0, "Usage: help [topic]", "List functions and their usage", c_help, 1},
-{"inform",   0x000,  1, "Usage: inform <on | off>", "Toggle user login messages", c_inform, 1},
-{"last",     0x000,  0, "Usage: last", "Display last message in current folder", c_last, 1},
-{"latest",   0x000,  0, "Usage: latest", "List last message in all folders", c_latest, 1},
-{"list",     0x000,  0, "Usage: list", "List all folders", c_listall, 1},
-{"listall",          0x000,  0, "Usage: listall", "List all folders", c_listall, 1},
-{"listnew",          0x000,  0, "Usage: listnew", "List available new messages", c_listnew, 1},
-{"listusers",        0x000,  0, "Usage: listusers", "List all users known", c_listusers, 1},
-{"locale",   0x000,  0, "Usage: locale <locale>", "Change locale", c_locale, 1},
-{"ls",       0x000,  0, "Usage: ls [[-]many]", "List messages in this folder [[last] many]", c_ls, 1},
-{"mesg",     0x100,  2, "Usage: mesg <com> <id>", "Edit message <id> in this folder", c_mesg, 1},
-{"mod",      0x108,  0, "Usage: mod", "Process new moderated messages for this folder", c_mod, 1},
-{"msg",      0x000,  1, "Usage: msg <on | off>", "Toggle tell messages", c_msg, 1},
-{"n",        0x000,  0, "Usage: next", "Alias for next", c_next, 1},
-{"new",      0x000,  0, "Usage: new", "Display new messages", c_new, 1},
-{"newusers",         0x001,  0, "Usage: newusers", "List known unregistered users", c_newusers, 1},
-{"next",     0x000,  0, "Usage: next", "Display following message", c_next, 1},
-{"p",        0x000,  0, "Usage: previous", "Alias for previous", c_prev, 1},
-{"passwd",           0x100,  0, "Usage: passwd", "Change current password", c_passwd, 1},
-{"postinfo", 0x000,  1, "Usage: postinfo <on | off>", "Inform you of all new postings", c_postinfo, 1},
-{"previous",         0x000,  0, "Usage: previous", "Display preceeding message", c_prev, 1},
-{"pwd",      0x000,  0, "Usage: pwd", "Name the current folder", c_pwd, 1},
-{"qq",               0x000,  0, "Usage: qq", "Finish the session", c_quit, 1},
-{"quit",     0x000,  0, "Usage: quit", "Finish the session", c_quit, 1},
-{"qw",               0x000,  0, "Usage: who", "List current users", c_who, 1},
-{"r",                0x000,  1, "Usage: read <mesg id>", "Alias for read", c_read, 1},
-{"read",     0x000,  1, "Usage: read <mesg id>", "Read the identified message", c_read, 1},
-{"reply",    0x100,  0, "Usage: reply ", "Reply to the last read message", c_reply, 1},
-{"resubscribe",      0x000,  0, "Usage: resubscribe", "Resubscribe to the current folder", c_resub, 1},
-{"save",     0x110,  2, "Usage: save mesg file", "Save mesg in /tmp/file", c_save, 1},
-{"search",   0x001,  2, "Usage: search <type> <flags>", "List users with <flags> of <type>", c_search, 1},
-{"since",    0x000,  0, "Usage: since", "List users logged in since your last login", c_since, 1},
-{"status",   0x000,  0, "Usage: status", "Display user status", c_status, 1},
-{"su",               0x104,  1, "Usage: su <on | off>", "Toggle superuser powers", c_su, 1},
-{"talker",   0x020,  0, "Usage: talker", "Enter chat mode", c_chatmode, 1},
-{"tell",     0x020,  2, "Usage: tell <user> <message>", "Send message to user", c_tell, 1},
-{"tidyup",   0x101,  2, "Usage: tidyup <foldername> <mesg no>", "Remove messages from a folder upto message number", c_tidyup, 1},
-{"timeout",  0x040,  1, "Usage: timeout <time>", "Set your idle time logout", c_timeout, 1},
-{"timestamp",        0x000,  1, "Usage: timestamp <on | off>", "Print timestamps on messages", c_timestamp, 1},
-{"topten",   0x001,  1, "Usage: topten <foldername>", "List heaviest users of a folder", c_topten, 1},
-{"unalias",  0x100,  1, "Usage: unalias <alias | *>", "Remove the alias from the current session", c_unalias, 1},
-{"unsubscribe",      0x000,  0, "Usage: unsubscribe", "Unsubscribe from current folder", c_unsub, 1},
-{"user",     0x101,  2, "Usage: user <com> <name>", "User editing functions", c_user, 1},
-{"version",  0x000,  0, "Usage: version", "Display Version Info", c_version, 1},
-{"w",                0x100,  0, "Usage: write", "Alias for write", c_write, 1},
-{"wall",     0x001,  1, "Usage: wall <message...>", "Send message to ALL users", c_wall, 1},
-{"what",     0x000,  0, "Usage: what", "List current users status", t_what, 1},
-{"who",      0x000,  0, "Usage: who", "List current users", c_who, 1},
-{"wiz",      0x002,  1, "Usage: wiz <message>", "Send message to all wizchat users", c_wiz, 1},
-{"wizchat",  0x002,  1, "Usage: wizchat on|off", "Toggle wizchat", c_wizchat, 1},
-{"write",    0x100,  0, "Usage: write", "Post a message to the current folder", c_write, 1},
-{NULL,         0x000,  0, NULL, NULL, 0}
</span><span style="color: #000000;background-color: #ddffdd">+{"addfol",     0x001, 0, "Usage: addfol", "Create a folder", c_addfol, 1},
+{"alias",      0x000, 2, "Usage: alias <alias> <command>", "Add the alias to the current session", c_alias, 1},
+{"autosub",    0x001, 2, "Usage: autosub <folder> <yes | no>", "Force everyone's subscription to <folder>", c_autosub, 1},
+{"backward",   0x000, 0, "Usage: backward", "Display preceeding message", c_prev, 1},
+{"beep",       0x000, 1, "Usage: beep <on | off>", "Toggle audible beeps", c_beep, 1},
+{"board",      0x001, 1, "Usage: board [un]lock", "[un]lock the bbs to normal users", c_board, 1},
+{"catchup",    0x000, 0, "Usage: catchup <folder | all>", "Mark this or selected folder as read", c_catchup, 1},
+{"cd",         0x000, 1, "Usage: cd <folder>", "Change to a folder", c_cd, 1},
+{"changeinfo", 0x001, 1, "Usage: changeinfo <on|off>", "Toggle user status change messages", c_changeinfo, 1},
+{"charset",    0x000, 0, "Usage: charset <charset>", "Change character set", c_charset, 1},
+{"chat",       0x020, 0, "Usage: chat", "Enter chat mode", c_chatmode, 1},
+{"colour",     0x000, 0, "Usage: colour <on | off | list | n>", "Colour mode options", c_colouroff, 1},
+{"contact",    0x020, 0, "Usage: contact", "Changes your contact address", c_contact, 1},
+{"credits",    0x000, 0, "Usage: credits", "Display the credits", c_credits, 1},
+{"date",       0x000, 0, "Usage: date", "Display the current system date", c_date, 1},
+{"doing",      0x000, 0, "Usage: doing <message>", "Set <doing> field of who", c_doing, 1},
+{"emote",      0x002, 1, "Usage: emote <message>", "Send emotion to all wizchat users",c_emote, 1},
+{"first",      0x000, 0, "Usage: first", "Display first message in current folder", c_first, 1},
+{"folder",     0x001, 2, "Usage: folder <com> <name>", "Folder editing functions", c_folder, 1},
+{"forward",    0x000, 0, "Usage: forward", "Display following message", c_next, 1},
+{"help",       0x000, 0, "Usage: help [topic]", "List functions and their usage", c_help, 1},
+{"inform",     0x000, 1, "Usage: inform <on | off>", "Toggle user login messages", c_inform, 1},
+{"last",       0x000, 0, "Usage: last", "Display last message in current folder", c_last, 1},
+{"latest",     0x000, 0, "Usage: latest", "List last message in all folders", c_latest, 1},
+{"list",       0x000, 0, "Usage: list", "List all folders", c_listall, 1},
+{"listall",    0x000, 0, "Usage: listall", "List all folders", c_listall, 1},
+{"listnew",    0x000, 0, "Usage: listnew", "List available new messages", c_listnew, 1},
+{"listusers",  0x000, 0, "Usage: listusers", "List all users known", c_listusers, 1},
+{"locale",     0x000, 0, "Usage: locale <locale>", "Change locale", c_locale, 1},
+{"ls",         0x000, 0, "Usage: ls [[-]many]", "List messages in this folder [[last] many]", c_ls, 1},
+{"mesg",       0x000, 2, "Usage: mesg <com> <id>", "Edit message <id> in this folder", c_mesg, 1},
+{"mod",        0x008, 0, "Usage: mod", "Process new moderated messages for this folder", c_mod, 1},
+{"msg",        0x000, 1, "Usage: msg <on | off>", "Toggle tell messages", c_msg, 1},
+{"n",          0x000, 0, "Usage: next", "Alias for next", c_next, 1},
+{"new",        0x000, 0, "Usage: new", "Display new messages", c_new, 1},
+{"newusers",   0x001, 0, "Usage: newusers", "List known unregistered users", c_newusers, 1},
+{"next",       0x000, 0, "Usage: next", "Display following message", c_next, 1},
+{"p",          0x000, 0, "Usage: previous", "Alias for previous", c_prev, 1},
+{"passwd",     0x000, 0, "Usage: passwd", "Change current password", c_passwd, 1},
+{"postinfo",   0x000, 1, "Usage: postinfo <on | off>", "Inform you of all new postings", c_postinfo, 1},
+{"previous",   0x000, 0, "Usage: previous", "Display preceeding message", c_prev, 1},
+{"pwd",        0x000, 0, "Usage: pwd", "Name the current folder", c_pwd, 1},
+{"qq",         0x000, 0, "Usage: qq", "Finish the session", c_quit, 1},
+{"quit",       0x000, 0, "Usage: quit", "Finish the session", c_quit, 1},
+{"qw",         0x000, 0, "Usage: who", "List current users", c_who, 1},
+{"r",          0x000, 1, "Usage: read <mesg id>", "Alias for read", c_read, 1},
+{"read",       0x000, 1, "Usage: read <mesg id>", "Read the identified message", c_read, 1},
+{"reply",      0x000, 0, "Usage: reply ", "Reply to the last read message", c_reply, 1},
+{"resubscribe",0x000, 0, "Usage: resubscribe", "Resubscribe to the current folder", c_resub, 1},
+{"save",       0x010, 2, "Usage: save mesg file", "Save mesg in /tmp/file", c_save, 1},
+{"search",     0x001, 2, "Usage: search <type> <flags>", "List users with <flags> of <type>", c_search, 1},
+{"since",      0x000, 0, "Usage: since", "List users logged in since your last login", c_since, 1},
+{"status",     0x000, 0, "Usage: status", "Display user status", c_status, 1},
+{"su",         0x004, 1, "Usage: su <on | off>", "Toggle superuser powers", c_su, 1},
+{"talker",     0x020, 0, "Usage: talker", "Enter chat mode", c_chatmode, 1},
+{"tell",       0x020, 2, "Usage: tell <user> <message>", "Send message to user", c_tell, 1},
+{"tidyup",     0x001, 2, "Usage: tidyup <foldername> <mesg no>", "Remove messages from a folder upto message number", c_tidyup, 1},
+{"timeout",    0x040, 1, "Usage: timeout <time>", "Set your idle time logout", c_timeout, 1},
+{"timestamp",  0x000, 1, "Usage: timestamp <on | off>", "Print timestamps on messages", c_timestamp, 1},
+{"topten",     0x001, 1, "Usage: topten <foldername>", "List heaviest users of a folder", c_topten, 1},
+{"unalias",    0x000, 1, "Usage: unalias <alias | *>", "Remove the alias from the current session", c_unalias, 1},
+{"unsubscribe",0x000, 0, "Usage: unsubscribe", "Unsubscribe from current folder", c_unsub, 1},
+{"user",       0x001, 2, "Usage: user <com> <name>", "User editing functions", c_user, 1},
+{"version",    0x000, 0, "Usage: version", "Display Version Info", c_version, 1},
+{"w",          0x000, 0, "Usage: write", "Alias for write", c_write, 1},
+{"wall",       0x001, 1, "Usage: wall <message...>", "Send message to ALL users", c_wall, 1},
+{"what",       0x000, 0, "Usage: what", "List current users status", t_what, 1},
+{"who",        0x000, 0, "Usage: who", "List current users", c_who, 1},
+{"wiz",        0x002, 1, "Usage: wiz <message>", "Send message to all wizchat users", c_wiz, 1},
+{"wizchat",    0x002, 1, "Usage: wizchat on|off", "Toggle wizchat", c_wizchat, 1},
+{"write",      0x000, 0, "Usage: write", "Post a message to the current folder", c_write, 1},
+{NULL,         0x000, 0, NULL, NULL, 0}
</span> };
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#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">@@ -40,7 +40,7 @@ const char *partlist_user[]={
</span> 
 extern int busy;
 extern int mesg_waiting;
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 static void edit_all(struct user *_user)
 {
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-4'>
<strong>
src/client/folders.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/folders.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/folders.c
</span><span style="color: #aaaaaa">@@ -75,18 +75,18 @@ void add_folder(void)
</span> 
 void auto_subscribe(int folnum, int state)
 {
<span style="color: #000000;background-color: #ddffdd">+        int err;
</span>   int ufile;
        struct user usr;
<span style="color: #000000;background-color: #ffdddd">-        struct person *urec = &usr.record;
</span>   char buff[10];
 
        ufile = userdb_open(O_RDWR);
        if (ufile < 0)
                return;
        Lock_File(ufile); /*user file*/
<span style="color: #000000;background-color: #ffdddd">-        while(get_person(ufile, &usr))
-       {
-               set_subscribe(urec, folnum, state);
</span><span style="color: #000000;background-color: #ddffdd">+
+       for_each_user(&usr, ufile, err) {
+               set_subscribe(&usr, folnum, state);
</span>           update_user_fd(ufile, &usr);
        }
        Unlock_File(ufile);
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-5'>
<strong>
src/client/incoming.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/incoming.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/incoming.c
</span><span style="color: #aaaaaa">@@ -35,7 +35,7 @@ extern Alias rpc_list;
</span> extern Alias event_list;
 extern Alias onoff_list;
 extern Alias ipc_list;
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern int quietmode;
 extern ipc_connection_t *ipcsock;
 
<span style="color: #aaaaaa">@@ -646,7 +646,7 @@ static void display_content(ipc_message_t *msg)
</span>           if (verbose) force_text(msg, verbose, whom);
                force_text(msg, text, whom);
                if (reason) {
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER excuse = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *excuse = NULL;
</span>                   if (strcasecmp(type, "mrod")==0 || strcasecmp(type, "zod")==0) {
                                asprintf(&excuse, "Zebedee says \"%s\".", reason);
                        } else {
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-6'>
<strong>
src/client/init.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/init.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/init.c
</span><span style="color: #aaaaaa">@@ -32,7 +32,7 @@ extern Alias shutdown_list;
</span> #include "script.h"
 #include "frl.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 /* drop and restore user level privs */
 static int private_myid = -1;
</code></pre>

<br>
</li>
<li id='diff-7'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-7'>
<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">@@ -48,7 +48,7 @@ extern Alias force_list;
</span> extern Alias shutdown_list;
 extern Alias eventin_list;
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern unsigned long rights;
 extern int busy;
 extern int current_rights;
<span style="color: #aaaaaa">@@ -151,7 +151,7 @@ static JSBool js_print(JSContext *cx, unsigned int argc, jsval *vp)
</span> {
        unsigned int i;
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER msg = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *msg = NULL;
</span>   if (argc < 1) {
                return JS_TRUE;
        }
<span style="color: #aaaaaa">@@ -178,7 +178,7 @@ static JSBool js_print(JSContext *cx, unsigned int argc, jsval *vp)
</span> static JSBool js_mwexec(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER msg = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *msg = NULL;
</span>   if (argc < 1) {
                JS_ReportError(cx, "exec() expects an argument.");
                return JS_FALSE;
<span style="color: #aaaaaa">@@ -198,7 +198,7 @@ static JSBool js_mwexec(JSContext *cx, unsigned int argc, jsval *vp)
</span> static JSBool js_say(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER msg = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *msg = NULL;
</span> 
        if (argc < 1) {
                JS_ReportError(cx, "say() expects an argument.");
<span style="color: #aaaaaa">@@ -225,8 +225,8 @@ static JSBool js_say(JSContext *cx, unsigned int argc, jsval *vp)
</span> static JSBool js_rpc(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER msg = NULL;
-       AUTOFREE_BUFFER rpc_type = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *msg = NULL;
+       _autofree char *rpc_type = NULL;
</span>   char username[NAMESIZE+1]="";
        int broadcast=0;
 
<span style="color: #aaaaaa">@@ -262,8 +262,8 @@ static JSBool js_rpc(JSContext *cx, unsigned int argc, jsval *vp)
</span> static JSBool js_ipc(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER msg = NULL;
-       AUTOFREE_BUFFER username = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *msg = NULL;
+       _autofree char *username = NULL;
</span>   int broadcast=0;
        if (argc < 2) {
                JS_ReportError(cx, "Error: javascript ipc() expects 2 arguments");
<span style="color: #aaaaaa">@@ -386,8 +386,8 @@ static JSBool js_beep(JSContext *cx, unsigned int argc, jsval *vp)
</span> static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER jbind = NULL;
-       AUTOFREE_BUFFER function_name = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *jbind = NULL;
+       _autofree char *function_name = NULL;
</span>   int bind_type=-1;
        int i=1;
        char msg[MAXTEXTLENGTH];
<span style="color: #aaaaaa">@@ -512,7 +512,7 @@ static JSBool js_bind(JSContext *cx, unsigned int argc, jsval *vp)
</span> static JSBool js_unbind(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER jbind = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *jbind = NULL;
</span>   char *function_name=NULL;
        int bind_type=-1;
        char msg[MAXTEXTLENGTH];
<span style="color: #aaaaaa">@@ -772,7 +772,7 @@ size_t headlimit(  void  *ptr,  size_t  size, size_t nmemb, void *stream)
</span> static JSBool js_urlget(JSContext *cx, unsigned int argc, jsval *vp)
 {
        jsval *argv = JS_ARGV(cx, vp);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER url = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *url = NULL;
</span>   JSString *jsstr;
        char msg[MAXTEXTLENGTH];
 
<span style="color: #aaaaaa">@@ -949,8 +949,8 @@ static JSBool js_doquery(JSContext *cx, unsigned int argc, jsval *vp)
</span> {
        jsval *argv = JS_ARGV(cx, vp);
        struct js_db_result *dbres;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER dbname = NULL;
-       AUTOFREE_BUFFER query = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *dbname = NULL;
+       _autofree char *query = NULL;
</span>   jsval resobject_jsval;
        char path[1024];
        struct passwd *pw;
<span style="color: #aaaaaa">@@ -1008,7 +1008,7 @@ static JSBool js_store_get(JSContext *cx, JSHandleObject obj, JSHandleId idval, 
</span>   jsval sval;
        JSBool ret = JS_IdToValue(cx, *idval._, &sval);
        if (ret == JS_TRUE && JSVAL_IS_STRING(sval)) {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER key = JS_EncodeString(cx, JS_ValueToString(cx, sval));
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *key = JS_EncodeString(cx, JS_ValueToString(cx, sval));
</span>           char *val = userdb_get(USERDB_PUBLIC, user->record.name, key);
                if (val == NULL) {
                        *vp._ = JSVAL_VOID;
<span style="color: #aaaaaa">@@ -1026,8 +1026,8 @@ static JSBool js_store_set(JSContext *cx, JSHandleObject obj, JSHandleId idval, 
</span>   jsval sval;
        JSBool ret = JS_IdToValue(cx, *idval._, &sval);
        if (ret == JS_TRUE && JSVAL_IS_STRING(sval) && JSVAL_IS_STRING(*vp._)) {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER key = JS_EncodeString(cx, JS_ValueToString(cx, sval));
-               AUTOFREE_BUFFER val = JS_EncodeString(cx, JS_ValueToString(cx, *vp._));
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *key = JS_EncodeString(cx, JS_ValueToString(cx, sval));
+               _autofree char *val = JS_EncodeString(cx, JS_ValueToString(cx, *vp._));
</span>           userdb_set(USERDB_PUBLIC, user->record.name, key, val);
        }
        return JS_TRUE;
</code></pre>

<br>
</li>
<li id='diff-8'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-8'>
<strong>
src/client/log.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/log.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/log.c
</span><span style="color: #aaaaaa">@@ -15,7 +15,7 @@
</span> #include "uri.h"
 #include "user.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> static void *file_url(void * data);
 static void *file_tag(void * data);
 
</code></pre>

<br>
</li>
<li id='diff-9'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-9'>
<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">@@ -89,11 +89,9 @@ int current_rights = 0;
</span> 
 char clear_line[]="\033[M\r";
 
<span style="color: #000000;background-color: #ffdddd">-struct user *user = NULL;
-struct folder *fold = NULL;
-unsigned long loggedin; /* what time did they login */
</span><span style="color: #000000;background-color: #ddffdd">+static struct user mwuser;
+struct user * const user = &mwuser;
</span> unsigned long rights=(unsigned long)0;
<span style="color: #000000;background-color: #ffdddd">-unsigned long forced;
</span> 
 /* readline stuff */
 int UseRL=0;
<span style="color: #aaaaaa">@@ -126,18 +124,15 @@ void set_rights(void)
</span>   if (!internet && getuid()!=500) rights|=16l;
        if (u_reg(user)) rights|=32l;
        if (s_timeout(user)) rights|=64l;
<span style="color: #000000;background-color: #ffdddd">-        if (!forced) rights|=256l;
</span>   current_rights = RIGHTS_BBS;
 }
 
 static void set_prompt(void)
 {
<span style="color: #000000;background-color: #ffdddd">-        char pre[20];
</span><span style="color: #000000;background-color: #ddffdd">+   char pre[20] = {0};
</span> 
<span style="color: #000000;background-color: #ffdddd">-        if (UseRL)
-               sprintf(pre,"%s", "");
-               /*sprintf(pre,"%s",clear_line);*/
-       else strcpy(pre,"\r");
</span><span style="color: #000000;background-color: #ddffdd">+   if (!UseRL)
+               pre[0] = '\r';
</span> 
        if (is_stacked())
        {
<span style="color: #aaaaaa">@@ -149,12 +144,12 @@ static void set_prompt(void)
</span>                   snprintf(prompt,40, "%stalk{%d}-* ", pre, user->record.room);
                else
                if (u_god(user))
<span style="color: #000000;background-color: #ffdddd">-                        snprintf(prompt,40,"%s{%s}---* ",pre,fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+                   snprintf(prompt,40,"%s{%s}---* ", pre, user->folder.name);
</span>           else
                if (u_reg(user))
<span style="color: #000000;background-color: #ffdddd">-                        snprintf(prompt,40, "%s<%s>---> ",pre,fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+                   snprintf(prompt,40, "%s<%s>---> ", pre, user->folder.name);
</span>           else
<span style="color: #000000;background-color: #ffdddd">-                        snprintf(prompt,40, "%s[%s] _@/ ",pre,fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+                   snprintf(prompt,40, "%s[%s] _@/ ",pre, user->folder.name);
</span>   }
 }
 
<span style="color: #aaaaaa">@@ -365,14 +360,8 @@ int main(int argc, char **argv)
</span> 
        /* initialise random seed */
        srand(time(NULL));
<span style="color: #000000;background-color: #ffdddd">-
</span>   /* initialise termcap */
        init_termcap();
<span style="color: #000000;background-color: #ffdddd">-
-       /* create client user information */
-       user = calloc(1, sizeof(*user));
-       fold = calloc(1, sizeof(*fold));
-
</span>   output=stdout;
 
        if (folders_init())
<span style="color: #aaaaaa">@@ -479,8 +468,6 @@ int main(int argc, char **argv)
</span>           printf(_("\nTo view this help message, use the arguments:  -h, -help, or -?\n"));
                printf(_("To specify arguments, you may use '--', or '/' instead of '-'.\n\n"));
 
<span style="color: #000000;background-color: #ffdddd">-                free(user);
-               free(fold);
</span>           exit(0);
        }
 
<span style="color: #aaaaaa">@@ -513,11 +500,7 @@ int main(int argc, char **argv)
</span> 
        /* if any 'view and quit' options specified, then quit */
        if (view_new || view_since)
<span style="color: #000000;background-color: #ffdddd">-        {
-               free(user);
-               free(fold);
</span>           exit(0);
<span style="color: #000000;background-color: #ffdddd">-        }
</span> 
        if (inarg_num>-1) autoexec_arg = argv[inarg_num];
        else autoexec_arg = "";
<span style="color: #aaaaaa">@@ -570,8 +553,6 @@ int main(int argc, char **argv)
</span>           remote=true;
                show_new(user);
                update_user(user);
<span style="color: #000000;background-color: #ffdddd">-                free(user);
-               free(fold);
</span>           exit(0);
        }
 
<span style="color: #aaaaaa">@@ -585,22 +566,16 @@ int main(int argc, char **argv)
</span>           if (currentfolder==-1)
                {
                        fprintf(stderr,_("%s: Folder %s not found.\n"), argv[0], foldname);
<span style="color: #000000;background-color: #ffdddd">-                        free(user);
-                       free(fold);
</span>                   exit(-1);
                }
                if (!is_old(folduser, user))
                {
                        fprintf(stderr,_("%s: User %s not found.\n"), argv[0], folduser);
<span style="color: #000000;background-color: #ffdddd">-                        free(user);
-                       free(fold);
</span>                   exit(-1);
                }
                rt = atoi(argv[folderuser_replyto]);
                remote=true;
                add_msg(currentfolder, user, rt);
<span style="color: #000000;background-color: #ffdddd">-                free(user);
-               free(fold);
</span>           exit(0);
        }
 /*
<span style="color: #aaaaaa">@@ -626,8 +601,6 @@ int main(int argc, char **argv)
</span>           {
                        printf(_("The Board has been temporarily closed.\n"));
                        printf(_("Please call again soon.\n"));
<span style="color: #000000;background-color: #ffdddd">-                        free(user);
-                       free(fold);
</span>                   exit(0);
                }
        }
<span style="color: #aaaaaa">@@ -636,11 +609,8 @@ int main(int argc, char **argv)
</span>   if (targethost == NULL)
                targethost = "localhost";
 
<span style="color: #000000;background-color: #ffdddd">-        if (ipc_connect(targethost, user) < 0) {
-               free(user);
-               free(fold);
</span><span style="color: #000000;background-color: #ddffdd">+   if (ipc_connect(targethost, user) < 0)
</span>           exit(1);
<span style="color: #000000;background-color: #ffdddd">-        }
</span>   if ((s_quiet(user) || u_god(user)) && qflag)
        {
                extern int talker_logontype;
<span style="color: #aaaaaa">@@ -681,7 +651,7 @@ int main(int argc, char **argv)
</span>           printf(_("Wait here for a few minutes and an administrator might register you.\n"));
        }
        if (!autochat) printf(_("Type 'help' for help.\n"));
<span style="color: #000000;background-color: #ffdddd">-        loggedin=time(0);
</span><span style="color: #000000;background-color: #ddffdd">+   user->loggedin = time(0);
</span> 
        /* initialise script variables */
        script_init();
<span style="color: #aaaaaa">@@ -723,10 +693,10 @@ int main(int argc, char **argv)
</span> 
        /* list new BBS items */
        list_new_items(user,true);
<span style="color: #000000;background-color: #ffdddd">-        if (!get_folder_number(fold,currentfolder))
</span><span style="color: #000000;background-color: #ddffdd">+   if (!get_folder_number(&user->folder, currentfolder))
</span>   {
                currentfolder = -1;
<span style="color: #000000;background-color: #ffdddd">-                fold->name[0] = '\0';
</span><span style="color: #000000;background-color: #ddffdd">+           user->folder.name[0] = '\0';
</span>   }
 
        InitParser();
<span style="color: #aaaaaa">@@ -752,7 +722,7 @@ int main(int argc, char **argv)
</span>           if (is_stacked())
                {
                        disable_rl(1);
<span style="color: #000000;background-color: #ffdddd">-                        forced = pop_stack(comm,MAXTEXTLENGTH);
</span><span style="color: #000000;background-color: #ddffdd">+                   pop_stack(comm,MAXTEXTLENGTH);
</span>                   accept_command(comm);
                        tty_timeout = 50;
                }
<span style="color: #aaaaaa">@@ -886,8 +856,9 @@ void close_down(int exitmode, char *sourceuser, char *reason)
</span> 
 
        /* update user information */
<span style="color: #000000;background-color: #ffdddd">-        user->record.timeused += time(0) - loggedin;
-       user->record.lastlogout = time(0);
</span><span style="color: #000000;background-color: #ddffdd">+   time_t now = time(0);
+       user->record.timeused += now - user->loggedin;
+       user->record.lastlogout = now;
</span>   update_user(user);
 
        destroy_colours();
<span style="color: #aaaaaa">@@ -921,8 +892,6 @@ void close_down(int exitmode, char *sourceuser, char *reason)
</span>   mwlog("LOGOUT");
        sleep(1); //dodgy hack for race condition in checkonoff, cunningly we currently get woken by the very message we're waiting for.
 
<span style="color: #000000;background-color: #ffdddd">-        free(user);
-       free(fold);
</span>   ipc_close();
 
        exit(0);
<span style="color: #aaaaaa">@@ -1754,7 +1723,8 @@ char *part_user(const char *text, int status)
</span> {
        static int file=0;
        static int len=0;
<span style="color: #000000;background-color: #ffdddd">-        struct user usr;
</span><span style="color: #000000;background-color: #ddffdd">+   static struct user usr;
+       int err;
</span> 
        if (status==0)
        {
<span style="color: #aaaaaa">@@ -1762,9 +1732,11 @@ char *part_user(const char *text, int status)
</span>           if (file < 0)
                        return NULL;
                len=strlen(text);
<span style="color: #000000;background-color: #ffdddd">-        }
</span><span style="color: #000000;background-color: #ddffdd">+           err = fetch_first_user(file, &usr);
+       } else
+               err = fetch_next_user(file, &usr);
</span> 
<span style="color: #000000;background-color: #ffdddd">-        while (get_person(file, &usr))
</span><span style="color: #000000;background-color: #ddffdd">+   for (; err == 0; err = fetch_next_user(file, &usr))
</span>   {
                if (!u_del(&usr))
                {
</code></pre>

<br>
</li>
<li id='diff-10'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-10'>
<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">@@ -14,7 +14,7 @@
</span> #include "bb.h"
 #include "user.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 void send_mesg(char *from, const char *to, char *text, int wiz)
 {
</code></pre>

<br>
</li>
<li id='diff-11'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-11'>
<strong>
src/client/new.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/new.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/new.c
</span><span style="color: #aaaaaa">@@ -46,14 +46,14 @@ void list_new_items(struct user *user, int flag)
</span>              || allowed_w(fol,user))) /*allowed*/
                if (!flag || ((fol->last - user->record.lastread[count]) > 0
                          && allowed_r(fol,user)
<span style="color: #000000;background-color: #ffdddd">-                          && get_subscribe(&user->record, count))) /* subscribed */
</span><span style="color: #000000;background-color: #ddffdd">+                     && get_subscribe(user, count))) /* subscribed */
</span>           {
                        printf("%*s (",FOLNAMESIZE,fol->name);
                        putchar(allowed_r(fol,user)?'r':'-');
                        putchar(allowed_w(fol,user)?'w':'-');
                        putchar(is_private(fol,user)?'p':'-');
                        putchar(is_moderated(fol,user)?'m':'-');
<span style="color: #000000;background-color: #ffdddd">-                        putchar(get_subscribe(&user->record, count) ? 'S' : '-');
</span><span style="color: #000000;background-color: #ddffdd">+                   putchar(get_subscribe(user, count) ? 'S' : '-');
</span>                   line++;
                        if (flag)
                        {
<span style="color: #aaaaaa">@@ -156,7 +156,7 @@ static int read_new(struct user *user, struct folder *data, int folnum)
</span>                   }else
                        if (stringcmp(tmp,"unsubscribe",5))
                        {
<span style="color: #000000;background-color: #ffdddd">-                                set_subscribe(urec, folnum, false);
</span><span style="color: #000000;background-color: #ddffdd">+                           set_subscribe(user, folnum, false);
</span>                           printf(_("Unsubscribing from %s.\n"),data->name);
                                break;
                        }else
<span style="color: #aaaaaa">@@ -197,7 +197,7 @@ void show_new(struct user *user)
</span>   {
                if (data->status&1 /*active*/
                && allowed_r(data,user) /* allowed to read */
<span style="color: #000000;background-color: #ffdddd">-                && get_subscribe(&user->record, folnum)  /* currently subscribed */
</span><span style="color: #000000;background-color: #ddffdd">+           && get_subscribe(user, folnum)  /* currently subscribed */
</span>           && !(data->last<data->first || data->last==0)
                && !(data->last <= user->record.lastread[folnum]))
                {
</code></pre>

<br>
</li>
<li id='diff-12'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-12'>
<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">@@ -45,9 +45,7 @@ extern int currentfolder,last_mesg;
</span> extern FILE *output;
 extern int busy; /* if true dont display messages  i.e. during new/write */
 extern unsigned long rights;
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
-extern struct folder *fold;
-extern unsigned long loggedin;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern CommandList table[];
 extern void help_list(CommandList *cm, unsigned int hidestuff);
 
<span style="color: #aaaaaa">@@ -87,7 +85,7 @@ static void help(const char *topic, int wiz)
</span>   /* a help topic was given */
        else
        {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER x = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *x = NULL;
</span> 
                /* find the command in the list */
                c = table;
<span style="color: #aaaaaa">@@ -137,6 +135,8 @@ void c_cd(CommandList *cm, int argc, const char **argv, char *args)
</span>           printf(_("Unknown foldername.\n"));
        else
        {
<span style="color: #000000;background-color: #ddffdd">+                struct folder *fold = &user->folder;
+
</span>           get_folder_number(fold,i);
                if(!f_active(fold->status) || (!allowed_r(fold,user) && !allowed_w(fold,user)))
                {
<span style="color: #aaaaaa">@@ -172,7 +172,7 @@ void c_new(CommandList *cm, int argc, const char **argv, char *args)
</span>   busy++;
        show_new(user);
        busy--;
<span style="color: #000000;background-color: #ffdddd">-        get_folder_number(fold,currentfolder);
</span><span style="color: #000000;background-color: #ddffdd">+   get_folder_number(&user->folder, currentfolder);
</span>   update_user(user);
 }
 
<span style="color: #aaaaaa">@@ -182,18 +182,16 @@ void c_last(CommandList *cm, int argc, const char **argv, char *args)
</span>           printf(_("No current folder.\n"));
                return;
        }
<span style="color: #000000;background-color: #ffdddd">-        last_mesg=fold->last;
</span><span style="color: #000000;background-color: #ddffdd">+   last_mesg = user->folder.last;
</span>   printf(_("Moved to end of folder. (message %d)\n"),last_mesg);
        read_msg(currentfolder, last_mesg, user);
<span style="color: #000000;background-color: #ffdddd">-
</span> }
 
 void c_first(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        last_mesg=fold->first;
</span><span style="color: #000000;background-color: #ddffdd">+   last_mesg = user->folder.first;
</span>   printf(_("Moved to start of folder. (message %d)\n"),last_mesg);
        read_msg(currentfolder, last_mesg, user);
<span style="color: #000000;background-color: #ffdddd">-
</span> }
 
 void c_user(CommandList *cm, int argc, const char **argv, char *args)
<span style="color: #aaaaaa">@@ -469,9 +467,9 @@ void c_mesg(CommandList *cm, int argc, const char **argv, char *args)
</span> {
        update_user(user);
        busy++;
<span style="color: #000000;background-color: #ffdddd">-        mesg_edit(argv[1], fold, atoi(argv[2]), user);
</span><span style="color: #000000;background-color: #ddffdd">+   mesg_edit(argv[1], &user->folder, atoi(argv[2]), user);
</span>   busy--;
<span style="color: #000000;background-color: #ffdddd">-        mwlog("MESSAGE %s %s:%d",argv[1], fold->name, atoi(argv[2]));
</span><span style="color: #000000;background-color: #ddffdd">+   mwlog("MESSAGE %s %s:%d",argv[1], user->folder.name, atoi(argv[2]));
</span> }
 
 void c_latest(CommandList *cm, int argc, const char **argv, char *args)
<span style="color: #aaaaaa">@@ -556,7 +554,7 @@ void c_pwd(CommandList *cm, int argc, const char **argv, char *args)
</span>           printf(_("No current folder.\n"));
                return;
        }
<span style="color: #000000;background-color: #ffdddd">-        printf(_("Current folder = %s\n"),fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+   printf(_("Current folder = %s\n"), user->folder.name);
</span>   if (last_mesg==0)
                printf(_("You haven't read any messages in this folder yet.\n"));
        else
<span style="color: #aaaaaa">@@ -566,7 +564,7 @@ void c_pwd(CommandList *cm, int argc, const char **argv, char *args)
</span> void c_ls(CommandList *cm, int argc, const char **argv, char *args)
 {
        int many;
<span style="color: #000000;background-color: #ffdddd">-        if (allowed_r(fold,user))
</span><span style="color: #000000;background-color: #ddffdd">+   if (allowed_r(&user->folder, user))
</span>   {
                if (argc>1) many=atoi(argv[1]);
                else many=0;
<span style="color: #aaaaaa">@@ -838,23 +836,23 @@ void c_passwd(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void c_resub(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        if (get_subscribe(&user->record, currentfolder))
-               printf(_("You are already subscribed to %s.\n"),fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+   if (get_subscribe(user, currentfolder))
+               printf(_("You are already subscribed to %s.\n"), user->folder.name);
</span>   else
        {
<span style="color: #000000;background-color: #ffdddd">-                set_subscribe(&user->record, currentfolder, true);
-               printf(_("Resubscribing to %s.\n"),fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+           set_subscribe(user, currentfolder, true);
+               printf(_("Resubscribing to %s.\n"), user->folder.name);
</span>   }
 }
 
 void c_unsub(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        if (!get_subscribe(&user->record, currentfolder))
-               printf(_("Already Unsubscribed from %s.\n"),fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+   if (!get_subscribe(user, currentfolder))
+               printf(_("Already Unsubscribed from %s.\n"), user->folder.name);
</span>   else
        {
<span style="color: #000000;background-color: #ffdddd">-                set_subscribe(&user->record, currentfolder, false);
-               printf(_("Unsubscribing from %s.\n"),fold->name);
</span><span style="color: #000000;background-color: #ddffdd">+           set_subscribe(user, currentfolder, false);
+               printf(_("Unsubscribing from %s.\n"), user->folder.name);
</span>   }
 }
 
<span style="color: #aaaaaa">@@ -867,13 +865,15 @@ void c_read(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void c_prev(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        if (last_mesg<=fold->first) printf(_("You are already at the beginning of the folder.\n"));
</span><span style="color: #000000;background-color: #ddffdd">+   if (last_mesg <= user->folder.first)
+               printf(_("You are already at the beginning of the folder.\n"));
</span>   else if (read_msg(currentfolder, last_mesg-1, user)) last_mesg--;
 }
 
 void c_next(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        if (last_mesg>=fold->last) printf(_("You are already at the end of this folder.\n"));
</span><span style="color: #000000;background-color: #ddffdd">+   if (last_mesg >= user->folder.last)
+               printf(_("You are already at the end of this folder.\n"));
</span>   else if (read_msg(currentfolder, last_mesg+1, user)) last_mesg++;
 }
 
<span style="color: #aaaaaa">@@ -922,14 +922,14 @@ void c_status(CommandList *cm, int argc, const char **argv, char *args)
</span>           printf(_("You %s informed of user status changes.\n"),
                       s_changeinfo(user)?_("will"):_("will not"));
        if (*gr) printf(_("You belong to the following group(s) [%s]\n"),gr);
<span style="color: #000000;background-color: #ffdddd">-        printf(_("You are currently in folder %s, which you "),fold->name);
-       printf(get_subscribe(&user->record, currentfolder)?_("are"):_("are not"));
</span><span style="color: #000000;background-color: #ddffdd">+   printf(_("You are currently in folder %s, which you "), user->folder.name);
+       printf(get_subscribe(user, currentfolder)?_("are"):_("are not"));
</span>   printf(_(" subscribed to.\n"));
        if (user->record.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->record.timeout));
<span style="color: #000000;background-color: #ffdddd">-        time_on(user->record.timeused+(time(0) - loggedin));
</span><span style="color: #000000;background-color: #ddffdd">+   time_on(user->record.timeused+(time(0) - user->loggedin));
</span> }
 
 static void credits(void)
<span style="color: #aaaaaa">@@ -1005,6 +1005,8 @@ void c_catchup(CommandList *cm, int argc, const char **argv, char *args)
</span>   }else
        if (argc>1)
        {
<span style="color: #000000;background-color: #ddffdd">+                struct folder *fold = &user->folder;
+
</span>           if ((i=foldernumber(argv[1]))<0)
                {
                        printf(_("There is no folder '%s'\n"),argv[1]);
<span style="color: #aaaaaa">@@ -1019,13 +1021,13 @@ void c_catchup(CommandList *cm, int argc, const char **argv, char *args)
</span>           }
        }else
        {
<span style="color: #000000;background-color: #ffdddd">-                get_folder_number(fold,currentfolder);
</span><span style="color: #000000;background-color: #ddffdd">+           get_folder_number(&user->folder, currentfolder);
</span>           i=currentfolder;
        }
<span style="color: #000000;background-color: #ffdddd">-        user->record.lastread[i]=fold->last;
</span><span style="color: #000000;background-color: #ddffdd">+   user->record.lastread[i] = user->folder.last;
</span>   update_user(user);
<span style="color: #000000;background-color: #ffdddd">-        printf(_("Marking folder %s as read.\n"),fold->name);
-       get_folder_number(fold,currentfolder);
</span><span style="color: #000000;background-color: #ddffdd">+   printf(_("Marking folder %s as read.\n"), user->folder.name);
+       get_folder_number(&user->folder, currentfolder);
</span> }
 
 void c_date(CommandList *cm, int argc, const char **argv, char *args)
</code></pre>

<br>
</li>
<li id='diff-13'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-13'>
<strong>
src/client/script.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/script.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/script.c
</span><span style="color: #aaaaaa">@@ -29,7 +29,7 @@ extern Alias bind_list;
</span> 
 #define MAX_ARGC 128
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern unsigned long rights;
 extern int busy;
 extern int current_rights;
<span style="color: #aaaaaa">@@ -498,7 +498,7 @@ void scr_helpfile(const char *args)
</span>                   printf("No general help available on scripts.\n");
        }else
        {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER x = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *x = NULL;
</span> 
                inst=inst_table;
                while (inst->name != NULL && strcasecmp(inst->name, args)) {
</code></pre>

<br>
</li>
<li id='diff-14'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-14'>
<strong>
src/client/script_inst.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/script_inst.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/script_inst.c
</span><span style="color: #aaaaaa">@@ -28,7 +28,7 @@
</span> #include "util.h"
 #include "who.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern Alias alias_list;
 extern Alias bind_list;
 /* current script runaway variable */
<span style="color: #aaaaaa">@@ -137,8 +137,8 @@ Instruction inst_table[]={
</span> 
 void scr_time( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
-       AUTOFREE_BUFFER value = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
+       _autofree char *value = NULL;
</span>   time_t now = time(0);
 
        if (pc->argc < 1) {
<span style="color: #aaaaaa">@@ -158,7 +158,7 @@ void scr_time( struct code *pc, int fargc, char **fargv )
</span>   }
        else if (!strcasecmp(pc->inst->name, "useridle"))
        {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER uname = eval_arg(pc->argv[1], fargc, fargv);
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *uname = eval_arg(pc->argv[1], fargc, fargv);
</span> 
                if (script_debug) escprintf("- %s: Getting idletime of user '%s'.\n", pc->inst->name, uname);
 
<span style="color: #aaaaaa">@@ -213,8 +213,8 @@ void scr_time( struct code *pc, int fargc, char **fargv )
</span> void scr_say( struct code *pc, int fargc, char **fargv )
 {
        int i, size, count;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER tmp = NULL;
-       AUTOFREE_BUFFER p = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *tmp = NULL;
+       _autofree char *p = NULL;
</span>   char utf8buff[MAXTEXTLENGTH];
        int conversion_result;
 
<span style="color: #aaaaaa">@@ -296,7 +296,7 @@ void scr_showrunaway( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_output( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
</span>   int i;
 
        if (event_user==NULL)
<span style="color: #aaaaaa">@@ -320,8 +320,8 @@ void scr_output( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_wholist( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
-       AUTOFREE_BUFFER buff = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
+       _autofree char *buff = NULL;
</span> 
        if (pc->argc < 1) {
                if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
<span style="color: #aaaaaa">@@ -357,7 +357,7 @@ void scr_wholist( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_roomnum( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
</span>   char rn[10];
 
        /* set initial room to -1 for unknown */
<span style="color: #aaaaaa">@@ -399,7 +399,7 @@ void scr_roomnum( struct code *pc, int fargc, char **fargv )
</span>   }
        else if (!strcasecmp(pc->inst->name, "userroom"))
        {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER uname = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *uname = NULL;
</span>           int rnum = -1;
 
                uname=eval_arg(pc->argv[1], fargc, fargv);
<span style="color: #aaaaaa">@@ -435,8 +435,8 @@ void scr_roomnum( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_talkpriv( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
-       AUTOFREE_BUFFER buff = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
+       _autofree char *buff = NULL;
</span>   unsigned long mask = 0xffffffff;
 
        if (pc->argc < 1) {
<span style="color: #aaaaaa">@@ -606,8 +606,8 @@ int isanumul(const char *a, unsigned long *result, int onlydecimal)
</span> 
 void scr_compare( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER a = NULL;
-       AUTOFREE_BUFFER b = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *a = NULL;
+       _autofree char *b = NULL;
</span>   int aa=0, bb=0;
        int numeric=0;
 
<span style="color: #aaaaaa">@@ -684,8 +684,8 @@ void scr_compare( struct code *pc, int fargc, char **fargv )
</span> void scr_math( struct code *pc, int fargc, char **fargv )
 {
        int a, b;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER aa = NULL;
-       AUTOFREE_BUFFER bb = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *aa = NULL;
+       _autofree char *bb = NULL;
</span>   var_op_t var;
        int result=0;
 
<span style="color: #aaaaaa">@@ -753,8 +753,8 @@ void scr_math( struct code *pc, int fargc, char **fargv )
</span> void scr_math2( struct code *pc, int fargc, char **fargv )
 {
        int a;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER aa = NULL;
-       AUTOFREE_BUFFER bb = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *aa = NULL;
+       _autofree char *bb = NULL;
</span>   var_op_t var;
        int result=0;
 
<span style="color: #aaaaaa">@@ -800,7 +800,7 @@ void scr_math2( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_sleep( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER aa = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *aa = NULL;
</span>   int     a;
        struct timeval delay;
 
<span style="color: #aaaaaa">@@ -827,9 +827,9 @@ void scr_sleep( struct code *pc, int fargc, char **fargv )
</span> void scr_rand( struct code *pc, int fargc, char **fargv )
 {
        char    buff[20];
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER aa = NULL;
-       AUTOFREE_BUFFER bb = NULL;
-       AUTOFREE_BUFFER what = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *aa = NULL;
+       _autofree char *bb = NULL;
+       _autofree char *what = NULL;
</span>   int     a, b;
 
        if (pc->argc<3) {
<span style="color: #aaaaaa">@@ -872,10 +872,10 @@ void scr_rand( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_makestr( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER aa=NULL;
-       AUTOFREE_BUFFER bb=NULL;
-       AUTOFREE_BUFFER cc=NULL;
-       AUTOFREE_BUFFER out=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *aa=NULL;
+       _autofree char *bb=NULL;
+       _autofree char *cc=NULL;
+       _autofree char *out=NULL;
</span>   var_op_t var;
        int i, j;
 
<span style="color: #aaaaaa">@@ -916,10 +916,10 @@ void scr_makestr( struct code *pc, int fargc, char **fargv )
</span> 
 void scr_split( struct code *pc, int fargc, char **fargv )
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER aa=NULL;
-       AUTOFREE_BUFFER bb=NULL;
-       AUTOFREE_BUFFER cc=NULL;
-       AUTOFREE_BUFFER text=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *aa=NULL;
+       _autofree char *bb=NULL;
+       _autofree char *cc=NULL;
+       _autofree char *text=NULL;
</span>   var_op_t var1, var2;
 
        if (pc->argc<3) {
<span style="color: #aaaaaa">@@ -980,9 +980,9 @@ void scr_split( struct code *pc, int fargc, char **fargv )
</span> void scr_strcat( struct code *pc, int fargc, char **fargv )
 {
        var_op_t var;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER a=NULL;
-       AUTOFREE_BUFFER b=NULL;
-       AUTOFREE_BUFFER nbuff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *a=NULL;
+       _autofree char *b=NULL;
+       _autofree char *nbuff=NULL;
</span> 
        if (pc->argc<2) {
                if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
<span style="color: #aaaaaa">@@ -1009,8 +1009,8 @@ void scr_strcat( struct code *pc, int fargc, char **fargv )
</span> void scr_set(struct code *pc, int fargc, char **fargv)
 {
        var_op_t var;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
-       AUTOFREE_BUFFER text = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
+       _autofree char *text = NULL;
</span> 
        if (pc->argc < 2) {
                if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
<span style="color: #aaaaaa">@@ -1046,8 +1046,8 @@ void scr_set(struct code *pc, int fargc, char **fargv)
</span> void scr_getvar(struct code *pc, int fargc, char **fargv)
 {
        var_op_t var, var2;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
-       AUTOFREE_BUFFER value=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
+       _autofree char *value=NULL;
</span> 
        if (pc->argc < 2) {
                if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug);
<span style="color: #aaaaaa">@@ -1096,7 +1096,7 @@ void scr_getvar(struct code *pc, int fargc, char **fargv)
</span> void scr_unset(struct code *pc, int fargc, char **fargv)
 {
        var_op_t var;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
</span> 
        if (pc->argc < 1)
        {
<span style="color: #aaaaaa">@@ -1121,8 +1121,8 @@ void scr_clearvars(struct code *pc, int fargc, char **fargv)
</span> {
        var_op_t iter;
        var_op_t op;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER what = NULL;
-       AUTOFREE_BUFFER key = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *what = NULL;
+       _autofree char *key = NULL;
</span> 
        if (pc->argc > 1) {
                if (script_debug) printf("Error in %s at %s too many arguments.\n", pc->inst->name, pc->debug);
</code></pre>

<br>
</li>
<li id='diff-15'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-15'>
<strong>
src/client/strings.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/strings.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/strings.c
</span><span style="color: #aaaaaa">@@ -42,7 +42,7 @@ int pop_stack(char *string, int len)
</span> {
        int type=0;
        pop_cmd(string, len, &type);
<span style="color: #000000;background-color: #ffdddd">-        return (type && CMD_FORCED) != 0;
</span><span style="color: #000000;background-color: #ddffdd">+   return type;
</span> }
 
 void pop_cmd(char *string, int len, int *type)
<span style="color: #aaaaaa">@@ -62,13 +62,3 @@ void pop_cmd(char *string, int len, int *type)
</span>   }
        string[len]=0;
 }
<span style="color: #000000;background-color: #ffdddd">-
-/* common file functions */
-int err_open(const char *path,int type,int mode)
-{
-       int x;
-       x=open(path,type,mode);
-       if (x<0)
-               perror(path);
-       return(x);
-}
</span></code></pre>

<br>
</li>
<li id='diff-16'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-16'>
<strong>
src/client/strings.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/strings.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/strings.h
</span><span style="color: #aaaaaa">@@ -5,7 +5,6 @@
</span> #define CMD_BOARD 1       /* Always a board command, used by BOARDEXEC */
 #define CMD_TALKER     2       /* Always a talker command, used by EXEC     */
 #define CMD_TYPED      0       /* Was entered at the keyboard               */
<span style="color: #000000;background-color: #ffdddd">-#define CMD_FORCED      0x100   /* Forced by another user                    */
</span> 
 struct stacked_str {
        char *text;
<span style="color: #aaaaaa">@@ -18,6 +17,5 @@ void stack_str(char *string);
</span> int is_stacked(void);
 void pop_cmd(char *string, int len, int *type);
 int pop_stack(char *string, int len);
<span style="color: #000000;background-color: #ffdddd">-int err_open(const char *path,int type,int mode);
</span> 
 #endif /* STRINGS_H */
</code></pre>

<br>
</li>
<li id='diff-17'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-17'>
<strong>
src/client/talker.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/talker.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/talker.c
</span><span style="color: #aaaaaa">@@ -47,9 +47,7 @@ extern Alias shutdown_list;
</span> extern int busy; /* if true dont display messages  i.e. during new/write */
 extern unsigned long rights;
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
-extern struct folder *fold;
-extern unsigned long loggedin;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern int quietmode;
 static int runautoexec = 1;
 
<span style="color: #aaaaaa">@@ -911,7 +909,7 @@ void t_ungag(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void t_zod(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER excuse = remove_first_word(args);
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *excuse = remove_first_word(args);
</span>   ipc_message_t * msg = ipcmsg_create(IPC_ACTION, user->posn);
        json_t * j = json_init(NULL);
        json_addstring(j, "target", argv[1]);
<span style="color: #aaaaaa">@@ -925,7 +923,7 @@ void t_zod(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void t_mrod(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER excuse = remove_first_word(args);
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *excuse = remove_first_word(args);
</span>   ipc_message_t * msg = ipcmsg_create(IPC_ACTION, user->posn);
        json_t * j = json_init(NULL);
        json_addstring(j, "target", argv[1]);
<span style="color: #aaaaaa">@@ -939,7 +937,7 @@ void t_mrod(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void t_kick(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER excuse = remove_first_word(args);
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *excuse = remove_first_word(args);
</span>   ipc_message_t * msg = ipcmsg_create(IPC_ACTION, user->posn);
        json_t * j = json_init(NULL);
        json_addstring(j, "target", argv[1]);
<span style="color: #aaaaaa">@@ -954,7 +952,7 @@ void t_kick(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void t_remove(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER excuse = remove_first_word(args);
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *excuse = remove_first_word(args);
</span>   ipc_message_t * msg = ipcmsg_create(IPC_ACTION, user->posn);
        json_t * j = json_init(NULL);
        json_addstring(j, "target", argv[1]);
<span style="color: #aaaaaa">@@ -1051,7 +1049,7 @@ void t_linewrap(CommandList *cm, int argc, const char **argv, char *args)
</span> 
 void t_topic(CommandList *cm, int argc, const char **argv, char *args)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *buff=NULL;
</span> 
        if (argc == 1) {
                char *topic;
<span style="color: #aaaaaa">@@ -1169,7 +1167,7 @@ void enter_room(int room)
</span>   char *topic = db_room_get(room, "topic");
        if (topic != NULL) {
                if (*topic != 0) {
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *buff=NULL;
</span>                   asprintf(&buff, "Topic: %s\n", topic);
                        display_message(buff, 0, 1);
                }
<span style="color: #aaaaaa">@@ -1316,7 +1314,7 @@ void t_help(CommandList *cm, int argc, const char **argv, char *args)
</span>                   printf("No general help available for talker commands.\n");
        }else
        {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER x = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *x = NULL;
</span> 
                /* find the command in the list */
                c = chattable;
<span style="color: #aaaaaa">@@ -1367,7 +1365,7 @@ int ChangeRoom(char *room, int quiet)
</span>   struct room tmp;
        int i;
        unsigned short oldroom = user->record.room;
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *buff=NULL;
</span> 
        if (cm_test(user, CM_FROZEN))
        {
</code></pre>

<br>
</li>
<li id='diff-18'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-18'>
<strong>
src/client/talker_privs.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/talker_privs.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/talker_privs.c
</span><span style="color: #aaaaaa">@@ -11,7 +11,7 @@
</span> #include <gags.h>
 #include <util.h>
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern int quietmode;
 
 unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl, int theirapl, const char *from)
<span style="color: #aaaaaa">@@ -129,7 +129,7 @@ unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl
</span>           if (gi!=NULL)
                {
                        /* gag was enabled */
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *buff=NULL;
</span>                   asprintf(&buff, "*** %s", gi->gag);
                        display_message(buff, 1, 1);
                }
<span style="color: #aaaaaa">@@ -139,7 +139,7 @@ unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl
</span>                   gi = gag_find(oldg);
                        if (gi!=NULL)
                        {
<span style="color: #000000;background-color: #ffdddd">-                                AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                           _autofree char *buff=NULL;
</span>                           asprintf(&buff, "*** %s", gi->ungag);
                                display_message(buff, 1, 1);
                        }
</code></pre>

<br>
</li>
<li id='diff-19'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-19'>
<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">@@ -15,7 +15,7 @@
</span> #include "user.h"
 #include "mesg.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 // uri action table
 // action, minargc, maxargc, tcmode, needs su, function
</code></pre>

<br>
</li>
<li id='diff-20'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-20'>
<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">@@ -31,8 +31,7 @@ const char *partlist_search[]={
</span> "status", "special", "groups", "chatprivs", "chatmode", "protpower",
 "protlevel", NULL};
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
-extern struct folder *fold;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> extern int internet;
 
 char *getmylogin(void)
<span style="color: #aaaaaa">@@ -61,8 +60,6 @@ static int old_usr(struct user *usr)
</span>           if (strcmp(passwd, usr->record.passwd))
                {
                        printf(_("Login Incorrect.\n\n"));
<span style="color: #000000;background-color: #ffdddd">-                        SAFE_FREE(user);
-                       SAFE_FREE(fold);
</span>                   exit(0);
                }
        }
<span style="color: #aaaaaa">@@ -70,8 +67,6 @@ static int old_usr(struct user *usr)
</span>   {
                printf(_("Sorry, this username has been banned.\n"));
                printf(_("Have a nice day. *:-)\n"));
<span style="color: #000000;background-color: #ffdddd">-                SAFE_FREE(user);
-               SAFE_FREE(fold);
</span>           exit(0);
        }
        printf(_("Hello %s.\n"), usr->record.name);
<span style="color: #aaaaaa">@@ -117,11 +112,8 @@ gstart:
</span>   }
        strip_name(name);
        if (feof(stdin))
<span style="color: #000000;background-color: #ffdddd">-        {
-               SAFE_FREE(user);
-               SAFE_FREE(fold);
</span>           exit(0);
<span style="color: #000000;background-color: #ffdddd">-        }
</span><span style="color: #000000;background-color: #ddffdd">+
</span>   if (strlen(name)<1)
        {
                if (lname==NULL)
<span style="color: #aaaaaa">@@ -136,28 +128,6 @@ gstart:
</span>   }
 }
 
<span style="color: #000000;background-color: #ffdddd">-int get_person(int file, struct user *u)
-{
-       struct person *tmp = &u->record;
-       int no;
-
-       if (!(no=read(file,tmp,sizeof(*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);
-               SAFE_FREE(fold);
-               exit(-1);
-       }
-       u->posn = lseek(file, 0, SEEK_CUR) - sizeof(*tmp);
-
-       return true;
-}
-
</span> void pick_salt(char *salt)
 {
        strcpy(salt,"ab");
<span style="color: #aaaaaa">@@ -305,8 +275,6 @@ static int new_usr(char *name, struct user *u)
</span>           {
                        printf(_("User record '%s' cancelled.\n"),usr->name);
                        printf(_("Goodbye.\n"));
<span style="color: #000000;background-color: #ffdddd">-                        SAFE_FREE(user);
-                       SAFE_FREE(fold);
</span>                   exit(0);
                }
                strip_str(usr->realname);
<span style="color: #aaaaaa">@@ -318,7 +286,6 @@ static int new_usr(char *name, struct user *u)
</span>           mwlog("CREATED: %s <%s>",usr->realname, usr->contact);
                broadcast(3, "Created user %s: %s <%s>", name, usr->realname, usr->contact);
                set_defaults(usr);
<span style="color: #000000;background-color: #ffdddd">-                user=u;
</span>           printf(_("Creating new user %s\n"),name);
 
                userdb_write(u);
<span style="color: #aaaaaa">@@ -343,6 +310,7 @@ void login_ok(struct user *usr, int *autochat)
</span> 
 void list_users(int newonly)
 {
<span style="color: #000000;background-color: #ddffdd">+        int err;
</span>   int file;
        struct user usr;
        char stats[10],gr[10];
<span style="color: #aaaaaa">@@ -354,8 +322,7 @@ void list_users(int newonly)
</span>   if (file < 0)
                return;
 
<span style="color: #000000;background-color: #ffdddd">-        while (get_person(file, &usr))
-       {
</span><span style="color: #000000;background-color: #ddffdd">+   for_each_user(&usr, file, err) {
</span>           if (!newonly || ( newonly && !u_reg(&usr) ) )
                {
                        logout_time = usr.record.lastlogout;
<span style="color: #aaaaaa">@@ -385,6 +352,7 @@ void list_users(int newonly)
</span> 
 void list_users_since(long date)
 {
<span style="color: #000000;background-color: #ddffdd">+        int err;
</span>   int file;
        struct user usr;
        struct person *urec = &usr.record;
<span style="color: #aaaaaa">@@ -397,8 +365,7 @@ void list_users_since(long date)
</span>   if (file < 0)
                return;
 
<span style="color: #000000;background-color: #ffdddd">-        while (get_person(file, &usr))
-       {
</span><span style="color: #000000;background-color: #ddffdd">+   for_each_user(&usr, file, err) {
</span>           if (urec->lastlogout > date)
                {
                        logout_time = urec->lastlogout;
<span style="color: #aaaaaa">@@ -430,6 +397,7 @@ static void list_users_flags(int flags, int type, int inv)
</span> /*type: 0=status 1=special 2=group 3=chatmodes 4=chatprivs */
 /*inv: 0= with flags, 1=without flags */
 {
<span style="color: #000000;background-color: #ddffdd">+        int err;
</span>   int file;
        struct user usr;
        struct person *urec = &usr.record;
<span style="color: #aaaaaa">@@ -443,8 +411,7 @@ static void list_users_flags(int flags, int type, int inv)
</span>   if (file < 0)
                return;
 
<span style="color: #000000;background-color: #ffdddd">-        while (get_person(file,&usr))
-       {
</span><span style="color: #000000;background-color: #ddffdd">+   for_each_user(&usr, file, err) {
</span>           if (type==0) check=urec->status;
                else
                if (type==1) check=urec->special;
</code></pre>

<br>
</li>
<li id='diff-21'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-21'>
<strong>
src/client/user.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/user.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/user.h
</span><span style="color: #aaaaaa">@@ -6,7 +6,6 @@
</span> 
 char *getmylogin(void);
 void get_login(char *name, int autochat);
<span style="color: #000000;background-color: #ffdddd">-int get_person(int file, struct user *user);
</span> void list_users(int newonly);
 void list_users_since(long date);
 void login_ok(struct user *usr, int *autochat);
</code></pre>

<br>
</li>
<li id='diff-22'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-22'>
<strong>
src/client/who.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/who.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/who.c
</span><span style="color: #aaaaaa">@@ -26,7 +26,7 @@
</span> #include <util.h>
 
 extern int busy;
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 char *itime(unsigned long t)
 {
<span style="color: #aaaaaa">@@ -66,7 +66,7 @@ void display_wholist(int mode)
</span>   else
                format_message("\nPID    %-*s %-*s  Idle  What...",NAMESIZE,"Name",20,"RealName");
 
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER divider = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *divider = NULL;
</span>   for (int i = 0; i < screen_w(); i++) string_add(&divider, "-");
        format_message("%s", divider);
 
</code></pre>

<br>
</li>
<li id='diff-23'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-23'>
<strong>
src/folders.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/folders.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/folders.h
</span><span style="color: #aaaaaa">@@ -2,7 +2,6 @@
</span> #define FOLDERS_H
 
 #include <stdint.h>
<span style="color: #000000;background-color: #ffdddd">-#include "user.h"
</span> 
 #define FOLNAMESIZE    10      /* length of folder names */
 #define TOPICSIZE      30      /* length of the topic of the folder */
</code></pre>

<br>
</li>
<li id='diff-24'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-24'>
<strong>
src/perms.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/perms.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/perms.c
</span><span style="color: #aaaaaa">@@ -233,8 +233,10 @@ void show_fold_groups(char st, char *tmp, int flag)
</span>   tmp[pos] = '\0';
 }
 
<span style="color: #000000;background-color: #ffdddd">-int get_subscribe(struct person *usr, int folder)
</span><span style="color: #000000;background-color: #ddffdd">+int get_subscribe(struct user *user, int folder)
</span> {
<span style="color: #000000;background-color: #ddffdd">+        struct person *usr = &user->record;
+
</span>   if (folder<=31 && folder>=0)
        {
                if (usr->folders[0] & (1<<folder) )
<span style="color: #aaaaaa">@@ -255,8 +257,10 @@ int get_subscribe(struct person *usr, int folder)
</span>   }
 }
 
<span style="color: #000000;background-color: #ffdddd">-void set_subscribe(struct person *usr,int folder,int status)
</span><span style="color: #000000;background-color: #ddffdd">+void set_subscribe(struct user *user,int folder,int status)
</span> {
<span style="color: #000000;background-color: #ddffdd">+        struct person *usr = &user->record;
+
</span>   if (folder>=0 && folder<=31)
        {
                if (status==true)
</code></pre>

<br>
</li>
<li id='diff-25'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-25'>
<strong>
src/perms.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/perms.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/perms.h
</span><span style="color: #aaaaaa">@@ -21,7 +21,7 @@ int is_moderated(struct folder *fol, struct user *usr);
</span> char folder_stats(char *string, char stat);
 char folder_groups(const char *string, char stat);
 
<span style="color: #000000;background-color: #ffdddd">-void set_subscribe(struct person *user,int folder,int status);
-int get_subscribe(struct person *user, int folder);
</span><span style="color: #000000;background-color: #ddffdd">+void set_subscribe(struct user *user, int folder, int status);
+int get_subscribe(struct user *user, int folder);
</span> 
 #endif
</code></pre>

<br>
</li>
<li id='diff-26'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-26'>
<strong>
src/server/actions.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/actions.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/actions.c
</span><span style="color: #aaaaaa">@@ -95,7 +95,7 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
</span>                   json_addstring(ej, "verbose", "You hear a boing in the distance, closely followed by the distant wail of a hurdy-gurdy, which is suddenly terminated by a blood curdling scream, a C major chord explosion and a few curious springing noises...");
 
                        // kick the person
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *buff=NULL;
</span>                   if (reason != NULL) {
                                asprintf(&buff,"mr%s", reason);
                                json_addstring(ej, "reason", reason);
<span style="color: #aaaaaa">@@ -136,7 +136,7 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
</span>                   json_addstring(ej, "verbose", "You hear a boing in the distance");
 
                        // kick the person
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *buff=NULL;
</span>                   if (reason != NULL) {
                                asprintf(&buff,"zr%s", reason);
                                json_addstring(ej, "reason", reason);
<span style="color: #aaaaaa">@@ -188,7 +188,7 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
</span>                                  attacker_name, victim_name, gag_type(gtnum));
 
                        // change users mode
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *buff=NULL;
</span>                   asprintf(&buff,"+%d", gtnum);
                        ipc_message_t *update = ipcmsg_create(IPC_GAG, msg->head.src);
                        ipcmsg_destination(update, toid);
<span style="color: #aaaaaa">@@ -219,7 +219,7 @@ void accept_action(ipc_connection_t *conn, ipc_message_t *msg)
</span>                   json_addstring(ej, "text", "%s has just ungagged %s", attacker_name, victim_name);
 
                        // change users mode
<span style="color: #000000;background-color: #ffdddd">-                        AUTOFREE_BUFFER buff=NULL;
</span><span style="color: #000000;background-color: #ddffdd">+                   _autofree char *buff=NULL;
</span>                   asprintf(&buff,"-");
                        ipc_message_t *update = ipcmsg_create(IPC_GAG, msg->head.src);
                        ipcmsg_destination(update, toid);
</code></pre>

<br>
</li>
<li id='diff-27'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-27'>
<strong>
src/server/mwserv.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/mwserv.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/mwserv.c
</span><span style="color: #aaaaaa">@@ -48,7 +48,7 @@ static const struct cfg_default_opt defcfgs[] = {
</span> 
 static int config_init(void)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER homeconf = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *homeconf = NULL;
</span>   const char *homedir;
        int ret;
 
</code></pre>

<br>
</li>
<li id='diff-28'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-28'>
<strong>
src/server/servsock.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/servsock.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/servsock.c
</span><span style="color: #aaaaaa">@@ -244,7 +244,7 @@ void send_error(ipc_connection_t *conn, ipc_message_t *orig, const char *format,
</span> {
        va_list va;
        va_start(va, format);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER text = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *text = NULL;
</span>   vasprintf(&text, format, va);
        va_end(va);
 
<span style="color: #aaaaaa">@@ -311,7 +311,7 @@ void process_msg(ipc_connection_t *conn, ipc_message_t *msg)
</span> 
                json_t * j = json_init(NULL);
                json_addint(j, "uptime", now - uptime);
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER version = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *version = NULL;
</span>           asprintf(&version, "%s.%s.%s", VER_MAJ, VER_MIN, VER_TWK);
                json_addstring(j, "version", version);
                ipcmsg_json_encode(msg, j);
<span style="color: #aaaaaa">@@ -571,7 +571,7 @@ void msg_attach(ipc_message_t *msg, ipc_connection_t *conn)
</span>  **/
 void msg_apply_gag(struct user *from, ipc_message_t * msg, const char * field)
 {
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER newtext = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *newtext = NULL;
</span>   json_t * j = json_init(msg);
        const char * text = json_getstring(j, field);
 
</code></pre>

<br>
</li>
<li id='diff-29'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-29'>
<strong>
src/socket.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/socket.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/socket.c
</span><span style="color: #aaaaaa">@@ -307,7 +307,7 @@ int json_addstring(json_t * js, const char * key, const char * value, ...)
</span>   json_t * tmp;
        va_list va;
        va_start(va, value);
<span style="color: #000000;background-color: #ffdddd">-        AUTOFREE_BUFFER text = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+   _autofree char *text = NULL;
</span>   vasprintf(&text, value, va);
        va_end(va);
 
</code></pre>

<br>
</li>
<li id='diff-30'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-30'>
<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">@@ -52,21 +52,57 @@ void update_user(struct user *user)
</span>   close(outfile);
 }
 
<span style="color: #000000;background-color: #ddffdd">+static int fetch_user_fd(int fd, struct person *rec, off_t offset)
+{
+       ssize_t bytes = pread(fd, rec, sizeof(*rec), offset);
+       if (bytes == 0)
+               return 1; /* EOF */
+
+       if (bytes == sizeof(*rec))
+               return 0; /* Done */
+
+       /* Partial read or error */
+       perror("pread");
+       return -1;
+}
+
</span> int fetch_user(struct user *user, int32_t userposn)
 {
<span style="color: #000000;background-color: #ffdddd">-        struct person *record = &user->record;
</span>         int outfile = userdb_open(O_RDWR|O_CREAT);
        if (outfile < 0)
<span style="color: #000000;background-color: #ffdddd">-                return 1;
</span><span style="color: #000000;background-color: #ddffdd">+           return -1;
</span> 
<span style="color: #000000;background-color: #ffdddd">-        if (pread(outfile, record, sizeof(*record), userposn) != sizeof(*record)) {
-               perror("pread");
-               close(outfile);
-               return 1;
-       }
</span><span style="color: #000000;background-color: #ddffdd">+   int ret = fetch_user_fd(outfile, &user->record, userposn);
</span>         close(outfile);
<span style="color: #000000;background-color: #ffdddd">-        user->posn = userposn;
-       return 0;
</span><span style="color: #000000;background-color: #ddffdd">+   if (ret == 0)
+               user->posn = userposn;
+       return ret;
+}
+
+int fetch_first_user(int fd, struct user *user)
+{
+       int ret;
+
+       if (user == NULL)
+               return -1;
+
+       ret = fetch_user_fd(fd, &user->record, 0);
+       if (ret == 0)
+               user->posn = 0;
+       return ret;
+}
+
+int fetch_next_user(int fd, struct user *user)
+{
+       int ret;
+
+       if (user == NULL)
+               return -1;
+
+       ret = fetch_user_fd(fd, &user->record, user->posn + sizeof(user->record));
+       if (ret == 0)
+               user->posn += sizeof(user->record);
+       return ret;
</span> }
 
 static int user_find_name(const char *name, struct user *user, int *found)
</code></pre>

<br>
</li>
<li id='diff-31'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-31'>
<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">@@ -2,6 +2,8 @@
</span> #define USER_H
 
 #include <stdint.h>
<span style="color: #000000;background-color: #ddffdd">+#include <time.h>
+#include "folders.h"
</span> #include "rooms.h"
 
 #define NAMESIZE       16      /* username */
<span style="color: #aaaaaa">@@ -71,15 +73,24 @@ struct person
</span> struct user {
        int32_t posn;
        struct person record;
<span style="color: #000000;background-color: #ddffdd">+        struct folder folder;
</span>   struct room room;
<span style="color: #000000;background-color: #ddffdd">+        time_t loggedin;
</span> };
 
 extern int userdb_open(int flags);
 extern void userdb_write(struct user *user);
 extern int fetch_user(struct user *record, int32_t userposn);
<span style="color: #000000;background-color: #ddffdd">+extern int fetch_first_user(int fd, struct user *user);
+extern int fetch_next_user(int fd, struct user *user);
</span> extern void update_user(struct user *user);
 extern int update_user_fd(int fd, struct user *user);
 extern int is_old(const char *name, struct user *user);
 extern struct user* user_get(const char *name);
 
<span style="color: #000000;background-color: #ddffdd">+#define for_each_user(userp, fd, status) \
+       for((status) = fetch_first_user((fd), (userp)); \
+        (status) == 0; \
+        (status) = fetch_next_user((fd), (userp)))
+
</span> #endif
</code></pre>

<br>
</li>
<li id='diff-32'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-32'>
<strong>
src/util.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/util.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/util.h
</span><span style="color: #aaaaaa">@@ -2,20 +2,14 @@
</span> #define UTIL_H
 
 #include <stdlib.h>
<span style="color: #000000;background-color: #ddffdd">+#include <unistd.h>
</span> 
<span style="color: #000000;background-color: #ffdddd">-/* TR's auto-free asprintf type stuff */
-__attribute__((unused)) static inline void cleanup_buffer(void *buffer)
</span><span style="color: #000000;background-color: #ddffdd">+__attribute__((unused)) static inline void cleanup_free(void *x)
</span> {
<span style="color: #000000;background-color: #ffdddd">-        char **b = buffer;
-       if (NULL != *b)
-       {
-               free(*b);
-       }
</span><span style="color: #000000;background-color: #ddffdd">+   free(*((void **)x));
</span> }
<span style="color: #000000;background-color: #ffdddd">-#define AUTOFREE_BUFFER __attribute__((cleanup(cleanup_buffer))) char *
-
</span><span style="color: #000000;background-color: #ddffdd">+#define _autofree __attribute__((cleanup(cleanup_free)))
</span> 
 #define SAFE_FREE(a)   do { if (a) { free(a); (a) = NULL; } } while(0);
 
<span style="color: #000000;background-color: #ffdddd">-
</span> #endif /* UTIL_H */
</code></pre>

<br>
</li>
<li id='diff-33'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-33'>
<strong>
src/webclient/comms.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/webclient/comms.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/webclient/comms.c
</span><span style="color: #aaaaaa">@@ -42,7 +42,7 @@ int die = 0;
</span> extern time_t lastcomm;
 extern char * authtext;
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> 
 typedef struct {
        struct list_head list;
<span style="color: #aaaaaa">@@ -453,9 +453,9 @@ static int handle_command(CONNECTION *co)
</span>                 return 1;
         }else
         if (co->authd && strncasecmp(buff, "replay ", 7)==0) {
<span style="color: #000000;background-color: #ffdddd">-                AUTOFREE_BUFFER style=NULL;
-               AUTOFREE_BUFFER value=NULL;
-               AUTOFREE_BUFFER line = NULL;
</span><span style="color: #000000;background-color: #ddffdd">+           _autofree char *style=NULL;
+               _autofree char *value=NULL;
+               _autofree char *line = NULL;
</span>           char *tmpu;
                style = remove_first_word(buff);
                value = remove_first_word(style);
</code></pre>

<br>
</li>
<li id='diff-34'>
<a href='https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6#diff-34'>
<strong>
src/webclient/import.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/webclient/import.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/webclient/import.c
</span><span style="color: #aaaaaa">@@ -15,7 +15,7 @@
</span> #include <bb.h>
 #include "import.h"
 
<span style="color: #000000;background-color: #ffdddd">-extern struct user *user;
</span><span style="color: #000000;background-color: #ddffdd">+extern struct user * const user;
</span> int incoming_pipe = -1;
 
 #define min(a,b) a<b?a:b
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://projects.sucs.org/arthur/mw/compare/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6">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/c30536af79c24adf5249ae06ad4c8e8e44b7ea67...d881fc863cfee125b72b8c07e89090b7a4dceeb6"}}</script>
</p>
</div>
</body>
</html>