From 3660ef70e332fd62f751ee339fa2a345520a485c Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Sat, 3 Mar 2007 00:37:35 +0000 Subject: [PATCH] Command and function names may now start with punctuation characters; better error messages for invalid function restrictions --- src/function.c | 7 +++++-- src/predicat.c | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/function.c b/src/function.c index b231a95..ce234c6 100644 --- a/src/function.c +++ b/src/function.c @@ -1074,11 +1074,14 @@ restrict_function(const char *name, const char *restriction) void do_function_restrict(dbref player, const char *name, const char *restriction) { + FUN *fp; + unsigned int flags; + if (!Global_Funcs(player)) { notify(player, T("Permission denied.")); return; } - if (!name) { + if (!name || !*name) { notify(player, T("Restrict what function?")); return; } @@ -1089,7 +1092,7 @@ do_function_restrict(dbref player, const char *name, const char *restriction) if (restrict_function(name, restriction)) notify(player, T("Restrictions modified.")); else - notify(player, T("Restrict attempt failed.")); + notify(player, T("Restrictions modified.")); } diff --git a/src/predicat.c b/src/predicat.c index be72f28..87e4301 100644 --- a/src/predicat.c +++ b/src/predicat.c @@ -911,7 +911,8 @@ ok_command_name(const char *name) case '&': return 0; default: - if (!isupper((unsigned char) *name) && !isdigit((unsigned char) *name)) + if (!isupper((unsigned char) *name) && !isdigit((unsigned char) *name) + && !ispunct((unsigned char) *name)) return 0; } /* Everything else must be printable and non-space, and we need @@ -956,7 +957,7 @@ ok_function_name(const char *name) case '&': return 0; default: - if (!isupper((unsigned char) *name)) + if (!isupper((unsigned char) *name) && !ispunct((unsigned char) *name)) return 0; } /* Everything else must be printable and non-space, and we need -- 2.30.2