]> git.tuebingen.mpg.de Git - paraslash.git/commit
Avoid duplication of sender subcommands.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Sep 2015 17:43:39 +0000 (17:43 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 13 Nov 2015 08:13:26 +0000 (09:13 +0100)
commitc241ffeb4c05234e6e8215bb8f55566f9f9383bb
tree3cf492226f457dca9c72cf2ef1384da7e22b4b6e
parent64cc9685a1bfa789dbcc447d68493691727e11ba
Avoid duplication of sender subcommands.

The list of sender subcommands (add, delete, allow, deny, on, off)
is defined as an enumeration in send.h. This list is duplicated in
check_sender_args() of command.c which contains the six subcommands
as C-strings to be matched against the first word of the sender
command line.

For the code to work properly it is essential that the two subcommand
lists are identical, which is a bad design that is quite error
prone. Fortunately it is easy to avoid the duplication with a little
preprocessor fu.

Since the subcommands are spelled in lower case and there is no
toupper function in CPP, we need to change the subcommand part of the
enumeration constants to lower case. The bulk of the patch consists
in trivial changes of all the users of these constants.
command.c
dccp_send.c
http_send.c
send.h
udp_send.c