From: Pierre Habouzit Date: Wed, 15 Aug 2007 22:45:28 +0000 (+0200) Subject: fixes, cosmetics X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=193714be08fc91ae77ddd401c1273d1b0d42845d;p=apps%2Fmadmutt.git fixes, cosmetics Signed-off-by: Pierre Habouzit --- diff --git a/lib-lua/runtime.c b/lib-lua/runtime.c index f023277..b90d460 100644 --- a/lib-lua/runtime.c +++ b/lib-lua/runtime.c @@ -147,7 +147,7 @@ rx_t *luaM_rxnew(const char *val) char *luaM_pathnew(const char *val) { - char path[PATH_MAX]; + char path[_POSIX_PATH_MAX]; _mutt_expand_path(path, sizeof(path), val, 0); return m_strdup(path); } diff --git a/lib-mx/mx.c b/lib-mx/mx.c index 5d735c6..bebaa34 100644 --- a/lib-mx/mx.c +++ b/lib-mx/mx.c @@ -53,7 +53,7 @@ static mx_t const *mxfmts[] = { static int dotlock_file(const char *path, int retry) { - char lockfile[PATH_MAX]; + char lockfile[_POSIX_PATH_MAX]; snprintf(lockfile, sizeof(lockfile), "%s.lock", path); if (lockfile_create(lockfile, retry ? 1 : 0, 0)) { @@ -65,7 +65,7 @@ static int dotlock_file(const char *path, int retry) static int undotlock_file (const char *path) { - char lockfile[PATH_MAX]; + char lockfile[_POSIX_PATH_MAX]; snprintf(lockfile, sizeof(lockfile), "%s.lock", path); return lockfile_remove(lockfile); } diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index 257cd96..2103d25 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -768,7 +768,6 @@ int mutt_index_menu (void) #endif case OP_JUMP: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (isdigit (LastKey)) @@ -819,7 +818,6 @@ int mutt_index_menu (void) */ case OP_MAIN_DELETE_PATTERN: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -832,14 +830,12 @@ int mutt_index_menu (void) break; case OP_MAIN_FETCH_MAIL: - CHECK_ATTACH; pop_fetch_mail (); menu->redraw = REDRAW_FULL; break; case OP_HELP: - mutt_help (MENU_MAIN); menu->redraw = REDRAW_FULL; break; @@ -860,7 +856,6 @@ int mutt_index_menu (void) case OP_MAIN_LIMIT: case OP_TOGGLE_READ: - CHECK_IN_MAILBOX; menu->oldcurrent = (Context->vcount && menu->current >= 0 && menu->current < @@ -908,7 +903,6 @@ int mutt_index_menu (void) break; case OP_QUIT: - closed = op; if (attach_msg) { done = 1; @@ -942,7 +936,6 @@ int mutt_index_menu (void) case OP_SEARCH_REVERSE: case OP_SEARCH_NEXT: case OP_SEARCH_OPPOSITE: - CHECK_MSGCOUNT; CHECK_VISIBLE; if ((menu->current = mutt_search_command (menu->current, op)) == -1) @@ -953,7 +946,6 @@ int mutt_index_menu (void) case OP_SORT: case OP_SORT_REVERSE: - if (mutt_select_sort ((op == OP_SORT_REVERSE)) == 0) { if (Context && Context->msgcount) { resort_index (menu); @@ -963,7 +955,6 @@ int mutt_index_menu (void) break; case OP_TAG: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (tag && !option (OPTAUTOTAG)) { @@ -987,7 +978,6 @@ int mutt_index_menu (void) break; case OP_MAIN_TAG_PATTERN: - CHECK_MSGCOUNT; CHECK_VISIBLE; mutt_pattern_func (M_TAG, _("Tag messages matching: ")); @@ -995,7 +985,6 @@ int mutt_index_menu (void) break; case OP_MAIN_UNDELETE_PATTERN: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1008,7 +997,6 @@ int mutt_index_menu (void) break; case OP_MAIN_UNTAG_PATTERN: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (mutt_pattern_func (M_UNTAG, _("Untag messages matching: ")) == 0) @@ -1025,7 +1013,6 @@ int mutt_index_menu (void) break; case OP_MAIN_SYNC_FOLDER: - if (Context && !Context->msgcount) break; @@ -1225,7 +1212,6 @@ int mutt_index_menu (void) continue; case OP_EXIT: - closed = op; if (menu->menu == MENU_MAIN && attach_msg) { done = 1; @@ -1245,7 +1231,6 @@ int mutt_index_menu (void) break; case OP_EDIT_TYPE: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_ATTACH; @@ -1260,7 +1245,6 @@ int mutt_index_menu (void) break; case OP_MAIN_BREAK_THREAD: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1290,7 +1274,6 @@ int mutt_index_menu (void) break; case OP_MAIN_LINK_THREADS: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1328,7 +1311,6 @@ int mutt_index_menu (void) break; case OP_MAIN_NEXT_UNDELETED: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (menu->current >= Context->vcount - 1) { @@ -1351,7 +1333,6 @@ int mutt_index_menu (void) break; case OP_NEXT_ENTRY: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (menu->current >= Context->vcount - 1) { @@ -1370,7 +1351,6 @@ int mutt_index_menu (void) break; case OP_MAIN_PREV_UNDELETED: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (menu->current < 1) { @@ -1392,7 +1372,6 @@ int mutt_index_menu (void) break; case OP_PREV_ENTRY: - CHECK_MSGCOUNT; CHECK_VISIBLE; if (menu->current < 1) { @@ -1451,7 +1430,6 @@ int mutt_index_menu (void) case OP_MAIN_PREV_UNREAD: case OP_MAIN_NEXT_NEW_THEN_UNREAD: case OP_MAIN_PREV_NEW_THEN_UNREAD: - { int first_unread = -1; int first_new = -1; @@ -1533,7 +1511,6 @@ int mutt_index_menu (void) break; } case OP_FLAG_MESSAGE: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1566,7 +1543,6 @@ int mutt_index_menu (void) break; case OP_TOGGLE_NEW: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1608,7 +1584,6 @@ int mutt_index_menu (void) break; case OP_TOGGLE_WRITE: - CHECK_IN_MAILBOX; if (mx_toggle_write (Context) == 0) menu->redraw |= REDRAW_STATUS; @@ -1618,7 +1593,6 @@ int mutt_index_menu (void) case OP_MAIN_NEXT_SUBTHREAD: case OP_MAIN_PREV_THREAD: case OP_MAIN_PREV_SUBTHREAD: - CHECK_MSGCOUNT; CHECK_VISIBLE; switch (op) { @@ -1656,7 +1630,6 @@ int mutt_index_menu (void) break; case OP_MAIN_PARENT_MESSAGE: - CHECK_MSGCOUNT; CHECK_VISIBLE; @@ -1673,7 +1646,6 @@ int mutt_index_menu (void) case OP_MAIN_SET_FLAG: case OP_MAIN_CLEAR_FLAG: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1782,7 +1754,6 @@ int mutt_index_menu (void) */ case OP_BOUNCE_MESSAGE: - CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; @@ -1790,7 +1761,6 @@ int mutt_index_menu (void) break; case OP_CREATE_ALIAS: - mutt_create_alias (Context && Context->vcount ? CURHDR->env : NULL, NULL); MAYBE_REDRAW (menu->redraw); @@ -1805,7 +1775,6 @@ int mutt_index_menu (void) case OP_PURGE_MESSAGE: case OP_DELETE: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1845,7 +1814,6 @@ int mutt_index_menu (void) case OP_DELETE_THREAD: case OP_DELETE_SUBTHREAD: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1877,14 +1845,12 @@ int mutt_index_menu (void) #endif case OP_DISPLAY_ADDRESS: - CHECK_MSGCOUNT; CHECK_VISIBLE; mutt_display_address (CURHDR->env); break; case OP_ENTER_COMMAND: - CurrentMenu = MENU_MAIN; mutt_enter_command (); mutt_check_rescore (Context); @@ -1895,7 +1861,6 @@ int mutt_index_menu (void) break; case OP_EDIT_MESSAGE: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -1911,7 +1876,6 @@ int mutt_index_menu (void) break; case OP_FORWARD_MESSAGE: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_ATTACH; @@ -1923,7 +1887,6 @@ int mutt_index_menu (void) break; case OP_GROUP_REPLY: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_ATTACH; @@ -1937,7 +1900,6 @@ int mutt_index_menu (void) break; case OP_LIST_REPLY: - CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; @@ -1951,7 +1913,6 @@ int mutt_index_menu (void) break; case OP_MAIL: - CHECK_ATTACH; ci_send_message (0, NULL, NULL, Context, NULL); menu->redraw = REDRAW_FULL; @@ -2013,14 +1974,12 @@ int mutt_index_menu (void) break; case OP_RECALL_MESSAGE: - CHECK_ATTACH; ci_send_message (SENDPOSTPONED, NULL, NULL, Context, NULL); menu->redraw = REDRAW_FULL; break; case OP_RESEND: - CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; @@ -2042,7 +2001,6 @@ int mutt_index_menu (void) case OP_POST: case OP_FOLLOWUP: case OP_FORWARD_TO_GROUP: - CHECK_ATTACH; if ((op == OP_FOLLOWUP || op == OP_FORWARD_TO_GROUP) && Context && Context->msgcount == 0) { @@ -2078,7 +2036,6 @@ int mutt_index_menu (void) #endif case OP_REPLY: - CHECK_ATTACH; CHECK_MSGCOUNT; CHECK_VISIBLE; @@ -2091,14 +2048,12 @@ int mutt_index_menu (void) break; case OP_SHELL_ESCAPE: - mutt_shell_escape (); MAYBE_REDRAW (menu->redraw); break; case OP_TAG_THREAD: case OP_TAG_SUBTHREAD: - CHECK_MSGCOUNT; CHECK_VISIBLE; rc = mutt_thread_set_flag (CURHDR, M_TAG, !CURHDR->tagged, @@ -2116,7 +2071,6 @@ int mutt_index_menu (void) break; case OP_UNDELETE: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -2143,7 +2097,6 @@ int mutt_index_menu (void) case OP_UNDELETE_THREAD: case OP_UNDELETE_SUBTHREAD: - CHECK_MSGCOUNT; CHECK_VISIBLE; CHECK_READONLY; @@ -2204,6 +2157,7 @@ int mutt_index_menu (void) case OP_SIDEBAR_PREV_NEW: sidebar_scroll (op); break; + default: if (menu->menu == MENU_MAIN) km_error_key (MENU_MAIN);