summaryrefslogtreecommitdiff
path: root/src/users.c
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-23 18:58:13 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-23 18:58:13 +0000
commitc15707a0181a8eaebf2458bde11a9232acfb0194 (patch)
tree3d7ca2cf35759c156c4491086e0f4520af5a34fd /src/users.c
parent4bf22fa2e6192d2321593377d847ac676af4d856 (diff)
Fix bug with User::SetRealname crashing when a user with a custom GECOS connects.
Fix handling of Anope's current directory, binary name, binary directory, and data directory. This also fixes using /os restart if run from outside the bin directory. (The second fix above is a little hackish, should look into cleaning it up later.) git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2462 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/users.c')
-rw-r--r--src/users.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/users.c b/src/users.c
index f6510ae3d..c019c136b 100644
--- a/src/users.c
+++ b/src/users.c
@@ -183,8 +183,7 @@ void User::SetRealname(const std::string &srealname)
this->realname = sstrdup(srealname.c_str());
NickAlias *na = findnick(this->nick);
- if (na && (nick_identified(this) ||
- (!(this->nc->flags & NI_SECURE) && nick_recognized(this))))
+ if (na && (nick_identified(this) || (!this->nc || (this->nc && !(this->nc->flags & NI_SECURE) && nick_recognized(this)))))
{
if (na->last_realname)
delete [] na->last_realname;
@@ -591,7 +590,7 @@ User *do_nick(const char *source, const char *nick, const char *username, const
}
delete [] logrealname;
}
-
+
/* Allocate User structure and fill it in. */
user = new User(nick, uid ? uid : "");
user->SetIdent(username);