Mostly trivial whitespace cleanups.

Clang-format and removing whitespace at the ends of lines.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
This commit is contained in:
Dan Cross 2018-10-16 15:21:42 +00:00 committed by Andrew Pamment
parent 359a190ee9
commit 32d1c70622
8 changed files with 193 additions and 194 deletions

View File

@ -368,7 +368,7 @@ char *get_file_id_diz(char *filename) {
} }
snprintf(buffer, sizeof buffer, "%s/node%d/temp", conf.bbs_path, mynode); snprintf(buffer, sizeof buffer, "%s/node%d/temp", conf.bbs_path, mynode);
if (access(buffer, F_OK|W_OK) == 0) { if (access(buffer, F_OK | W_OK) == 0) {
if (recursive_delete(buffer) != 0) { if (recursive_delete(buffer) != 0) {
return NULL; return NULL;
} }
@ -677,7 +677,7 @@ int do_upload(struct user_record *user, char *final_path) {
if (defproto->upload_prompt) { if (defproto->upload_prompt) {
snprintf(upload_command, 1024, "%s%s", upload_path, buffer3); snprintf(upload_command, 1024, "%s%s", upload_path, buffer3);
if (access(upload_command, W_OK|X_OK) != 0) { if (access(upload_command, W_OK | X_OK) != 0) {
recursive_delete(upload_path); recursive_delete(upload_path);
return 0; return 0;
} }

View File

@ -83,60 +83,59 @@ struct key_value_map {
}; };
static const struct key_value_map commands[] = { static const struct key_value_map commands[] = {
{ "SUBMENU", MENU_SUBMENU }, {"SUBMENU", MENU_SUBMENU},
{ "LOGOFF", MENU_LOGOFF }, {"LOGOFF", MENU_LOGOFF},
{ "PREVMENU", MENU_PREVMENU }, {"PREVMENU", MENU_PREVMENU},
{ "AUTOMESSAGE", MENU_AUTOMESSAGE }, {"AUTOMESSAGE", MENU_AUTOMESSAGE},
{ "TEXTFILES", MENU_TEXTFILES }, {"TEXTFILES", MENU_TEXTFILES},
{ "CHATSYSTEM", MENU_CHATSYSTEM }, {"CHATSYSTEM", MENU_CHATSYSTEM},
{ "BBSLIST", MENU_BBSLIST }, {"BBSLIST", MENU_BBSLIST},
{ "LISTUSERS", MENU_LISTUSERS }, {"LISTUSERS", MENU_LISTUSERS},
{ "BULLETINS", MENU_BULLETINS }, {"BULLETINS", MENU_BULLETINS},
{ "LAST10CALLERS", MENU_LAST10 }, {"LAST10CALLERS", MENU_LAST10},
{ "SETTINGS", MENU_SETTINGS }, {"SETTINGS", MENU_SETTINGS},
{ "RUNDOOR", MENU_DOOR }, {"RUNDOOR", MENU_DOOR},
{ "MAILSCAN", MENU_MAILSCAN }, {"MAILSCAN", MENU_MAILSCAN},
{ "READMAIL", MENU_READMAIL }, {"READMAIL", MENU_READMAIL},
{ "POSTMESSAGE", MENU_POSTMESSAGE }, {"POSTMESSAGE", MENU_POSTMESSAGE},
{ "CHOOSEMAILCONF", MENU_CHOOSEMAILCONF }, {"CHOOSEMAILCONF", MENU_CHOOSEMAILCONF},
{ "CHOOSEMAILAREA", MENU_CHOOSEMAILAREA }, {"CHOOSEMAILAREA", MENU_CHOOSEMAILAREA},
{ "SENDEMAIL", MENU_SENDEMAIL }, {"SENDEMAIL", MENU_SENDEMAIL},
{ "LISTEMAIL", MENU_LISTEMAIL }, {"LISTEMAIL", MENU_LISTEMAIL},
{ "NEXTMAILCONF", MENU_NEXTMAILCONF }, {"NEXTMAILCONF", MENU_NEXTMAILCONF},
{ "PREVMAILCONF", MENU_PREVMAILCONF }, {"PREVMAILCONF", MENU_PREVMAILCONF},
{ "NEXTMAILAREA", MENU_NEXTMAILAREA }, {"NEXTMAILAREA", MENU_NEXTMAILAREA},
{ "PREVMAILAREA", MENU_PREVMAILAREA }, {"PREVMAILAREA", MENU_PREVMAILAREA},
{ "BLUEWAVEDOWNLOAD", MENU_BLUEWAVEDOWN }, {"BLUEWAVEDOWNLOAD", MENU_BLUEWAVEDOWN},
{ "BLUEWAVEUPLOAD", MENU_BLUEWAVEUP }, {"BLUEWAVEUPLOAD", MENU_BLUEWAVEUP},
{ "CHOOSEFILEDIR", MENU_CHOOSEFILEDIR }, {"CHOOSEFILEDIR", MENU_CHOOSEFILEDIR},
{ "CHOOSEFILESUB", MENU_CHOOSEFILESUB }, {"CHOOSEFILESUB", MENU_CHOOSEFILESUB},
{ "LISTFILES", MENU_LISTFILES }, {"LISTFILES", MENU_LISTFILES},
{ "UPLOAD", MENU_UPLOAD }, {"UPLOAD", MENU_UPLOAD},
{ "DOWNLOAD", MENU_DOWNLOAD }, {"DOWNLOAD", MENU_DOWNLOAD},
{ "CLEARTAGGED", MENU_CLEARTAGGEDFILES }, {"CLEARTAGGED", MENU_CLEARTAGGEDFILES},
{ "NEXTFILEDIR", MENU_NEXTFILEDIR }, {"NEXTFILEDIR", MENU_NEXTFILEDIR},
{ "PREVFILEDIR", MENU_PREVFILEDIR }, {"PREVFILEDIR", MENU_PREVFILEDIR},
{ "NEXTFILESUB", MENU_NEXTFILESUB }, {"NEXTFILESUB", MENU_NEXTFILESUB},
{ "PREVFILESUB", MENU_PREVFILESUB }, {"PREVFILESUB", MENU_PREVFILESUB},
{ "LISTMESSAGES", MENU_LISTMESSAGES }, {"LISTMESSAGES", MENU_LISTMESSAGES},
{ "DOSCRIPT", MENU_DOSCRIPT }, {"DOSCRIPT", MENU_DOSCRIPT},
{ "SENDNODEMSG", MENU_SENDNODEMSG }, {"SENDNODEMSG", MENU_SENDNODEMSG},
{ "SUBUNSUBCONF", MENU_SUBUNSUBCONF }, {"SUBUNSUBCONF", MENU_SUBUNSUBCONF},
{ "RESETMSGPTRS", MENU_RESETPOINTERS }, {"RESETMSGPTRS", MENU_RESETPOINTERS},
{ "RESETALLMSGPTRS", MENU_RESETALLPOINTERS }, {"RESETALLMSGPTRS", MENU_RESETALLPOINTERS},
{ "FILESCAN", MENU_FILESCAN }, {"FILESCAN", MENU_FILESCAN},
{ "FULLMAILSCAN", MENU_FULLMAILSCAN }, {"FULLMAILSCAN", MENU_FULLMAILSCAN},
{ "FILESEARCH", MENU_FILESEARCH }, {"FILESEARCH", MENU_FILESEARCH},
{ "DISPLAYTXTFILE", MENU_DISPTXTFILE }, {"DISPLAYTXTFILE", MENU_DISPTXTFILE},
{ "DISPLAYTXTPAUSE", MENU_DISPTXTFILEPAUSE }, {"DISPLAYTXTPAUSE", MENU_DISPTXTFILEPAUSE},
{ "GENWWWURLS", MENU_GENWWWURLS }, {"GENWWWURLS", MENU_GENWWWURLS},
{ "NLBROWSER", MENU_NLBROWSER }, {"NLBROWSER", MENU_NLBROWSER},
{ "SENDFEEDBACK", MENU_SENDFEEDBACK }, {"SENDFEEDBACK", MENU_SENDFEEDBACK},
{ "BLOGDISPLAY", MENU_BLOGDISPLAY }, {"BLOGDISPLAY", MENU_BLOGDISPLAY},
{ "BLOGWRITE", MENU_BLOGWRITE } {"BLOGWRITE", MENU_BLOGWRITE}};
};
#define ARRAY_SIZE(A) (sizeof(A)/sizeof((A)[0])) #define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
int cmd2cmd(const char *cmd) { int cmd2cmd(const char *cmd) {
for (size_t i = 0; i < ARRAY_SIZE(commands); ++i) for (size_t i = 0; i < ARRAY_SIZE(commands); ++i)