From 7fca953dde29dcdaae941b35356d10d07b9bf610 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 1 Mar 2010 19:18:31 +0100 Subject: [PATCH] ja ja ja! --- world/net/library/text.c | 22 ++++++++++++---------- world/net/place/threads.c | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/world/net/library/text.c b/world/net/library/text.c index c1f3411..25b2e8b 100644 --- a/world/net/library/text.c +++ b/world/net/library/text.c @@ -172,20 +172,22 @@ varargs void w(string mc, string data, mixed vars) { } #endif -// a simple implementation of perl's x operator -string x(string str, int n) { - int i; - string res = ""; - for (i = 0; i < n; i++) res += str; - return res; +// a simple implementation of perl's x repetition operator +string repeat(string str, int n) { + int i; + string res = ""; + for (i = 0; i < n; i++) res += str; + return res; } int is_true(string v) { - if (strlen(v) && regmatch(v, "^(?:on|yes|true|enabled|1)$")) return 1; - return 0; + if (strlen(v) && regmatch(v, "^(?:on|yes|y|ja|true|enabled|1)$")) + return 1; + return 0; } int is_false(string v) { - if (strlen(v) && regmatch(v, "^(?:off|no|false|disabled|0)$")) return 1; - return 0; + if (strlen(v) && regmatch(v, "^(?:off|no|n|nein|false|disabled|0)$")) + return 1; + return 0; } diff --git a/world/net/place/threads.c b/world/net/place/threads.c index 243eda3..95f17da 100644 --- a/world/net/place/threads.c +++ b/world/net/place/threads.c @@ -180,7 +180,7 @@ sendEntries(mixed source, array(mixed) entries, int level) { vars = entry[LOG_VARS]; sendmsg(source, regreplace(entry[LOG_MC], "^_notice", "_list", 1), "[_indent][_nick]: "+ (vars["_title"] ? "[_title]\n" : "") +"[_text] (#[_id])", - vars + ([ "_level": level, "_indent": x(" ", level), "_postfix_time_log": 1 ])); + vars + ([ "_level": level, "_indent": repeat(" ", level), "_postfix_time_log": 1 ])); if (sizeof(entry) >= LOG_CHILDREN + 1) sendEntries(source, entry[LOG_CHILDREN], level + 1); n++; }