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);
if (access(buffer, F_OK|W_OK) == 0) {
if (access(buffer, F_OK | W_OK) == 0) {
if (recursive_delete(buffer) != 0) {
return NULL;
}
@ -677,7 +677,7 @@ int do_upload(struct user_record *user, char *final_path) {
if (defproto->upload_prompt) {
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);
return 0;
}

View File

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