mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 07:56:21 +00:00
Add slashguard feature
New command `/slashguard` tries to protect against typing ` /quit` by not allowing a slash in the first 4 characters.
This commit is contained in:
@@ -196,6 +196,13 @@ inp_readline(void)
|
||||
}
|
||||
|
||||
if (inp_line) {
|
||||
if (!get_password && prefs_get_boolean(PREF_SLASH_GUARD)) {
|
||||
char *res = (char*) memchr (inp_line+1, '/', 3);
|
||||
if (res) {
|
||||
cons_show("Your text contains a slash in the first 4 characters");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return strdup(inp_line);
|
||||
} else {
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user