aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/comproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-01-03 01:50:36 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-01-03 01:50:36 +0100
commit0b67be12abb6a4d6fe44eadc8a1fb0467b8e96d9 (patch)
tree63cd5a73397499d16fb410fee3c8e5855f95758c /FICS/comproc.c
parent8d26a84c8140353ad4568698d10bbe2fc15c97e9 (diff)
Reformatted com_unalias()
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r--FICS/comproc.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index d3fc981..dbc82a4 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -1416,27 +1416,36 @@ PUBLIC int com_alias(int p, param_list param)
return COM_OK;
}
-PUBLIC int com_unalias(int p, param_list param)
+PUBLIC int
+com_unalias(int p, param_list param)
{
- int al;
- int i;
+ int al;
- ASSERT(param[0].type == TYPE_WORD);
- al = alias_lookup(param[0].val.word, parray[p].alias_list, parray[p].numAlias);
- if (al < 0) {
- pprintf(p, "You have no alias named '%s'.\n", param[0].val.word);
- } else {
- rfree(parray[p].alias_list[al].comm_name);
- rfree(parray[p].alias_list[al].alias);
- for (i = al; i < parray[p].numAlias; i++) {
- parray[p].alias_list[i].comm_name = parray[p].alias_list[i + 1].comm_name;
- parray[p].alias_list[i].alias = parray[p].alias_list[i + 1].alias;
- }
- parray[p].numAlias--;
- parray[p].alias_list[parray[p].numAlias].comm_name = NULL;
- pprintf(p, "Alias removed.\n");
- }
- return COM_OK;
+ ASSERT(param[0].type == TYPE_WORD);
+
+ al = alias_lookup(param[0].val.word, parray[p].alias_list,
+ parray[p].numAlias);
+
+ if (al < 0) {
+ pprintf(p, "You have no alias named '%s'.\n",
+ param[0].val.word);
+ } else {
+ rfree(parray[p].alias_list[al].comm_name);
+ rfree(parray[p].alias_list[al].alias);
+
+ for (int i = al; i < parray[p].numAlias; i++) {
+ parray[p].alias_list[i].comm_name =
+ parray[p].alias_list[i + 1].comm_name;
+ parray[p].alias_list[i].alias =
+ parray[p].alias_list[i + 1].alias;
+ }
+
+ parray[p].numAlias--;
+ parray[p].alias_list[parray[p].numAlias].comm_name = NULL;
+ pprintf(p, "Alias removed.\n");
+ }
+
+ return COM_OK;
}
PUBLIC int