mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean up formatting.

Add spaces after if, else, while, for, switch.

Unify the brace placement style. The vast majority of the code uses
Allman style so convert the relatively few K&R braces over.

+513 -372
+2 -2
alias.c
··· 300 300 return; 301 301 } 302 302 303 - if((new->addr = rfc822_parse_adrlist (new->addr, buf)) == NULL) 303 + if ((new->addr = rfc822_parse_adrlist (new->addr, buf)) == NULL) 304 304 BEEP (); 305 305 if (mutt_addrlist_to_intl (new->addr, &err)) 306 306 { ··· 310 310 continue; 311 311 } 312 312 } 313 - while(new->addr == NULL); 313 + while (new->addr == NULL); 314 314 315 315 if (adr && adr->personal && !mutt_is_mail_list (adr)) 316 316 strfcpy (buf, adr->personal, sizeof (buf));
+15 -14
attach.c
··· 51 51 FILE *fpin = NULL, *fpout = NULL; 52 52 struct stat st; 53 53 54 - if(a->unlink) 54 + if (a->unlink) 55 55 return 0; 56 56 57 57 tempfile = mutt_buffer_pool_get (); ··· 63 63 64 64 rfc1524_free_entry(&entry); 65 65 66 - if(stat(a->filename, &st) == -1) 66 + if (stat(a->filename, &st) == -1) 67 67 { 68 68 mutt_buffer_pool_release (&tempfile); 69 69 return -1; 70 70 } 71 71 72 - if((fpin = fopen(a->filename, "r")) && /* __FOPEN_CHECKED__ */ 73 - (fpout = safe_fopen(mutt_b2s (tempfile), "w"))) 72 + if ((fpin = fopen(a->filename, "r")) && /* __FOPEN_CHECKED__ */ 73 + (fpout = safe_fopen(mutt_b2s (tempfile), "w"))) 74 74 { 75 75 mutt_copy_stream (fpin, fpout); 76 76 mutt_str_replace (&a->filename, mutt_b2s (tempfile)); 77 77 a->unlink = 1; 78 78 79 - if(a->stamp >= st.st_mtime) 79 + if (a->stamp >= st.st_mtime) 80 80 mutt_stamp_attachment(a); 81 81 } 82 82 else 83 83 mutt_perror(fpin ? mutt_b2s (tempfile) : a->filename); 84 84 85 - if(fpin) safe_fclose (&fpin); 86 - if(fpout) safe_fclose (&fpout); 85 + if (fpin) safe_fclose (&fpin); 86 + if (fpout) safe_fclose (&fpout); 87 87 88 88 mutt_buffer_pool_release (&tempfile); 89 89 ··· 162 162 a->parameter = b->parameter; 163 163 b->parameter = NULL; 164 164 } 165 - if (b->description) { 165 + if (b->description) 166 + { 166 167 FREE (&a->description); 167 168 a->description = b->description; 168 169 b->description = NULL; ··· 211 212 212 213 bailout: 213 214 214 - if(unlink_newfile) 215 + if (unlink_newfile) 215 216 unlink(mutt_b2s (newfile)); 216 217 217 218 mutt_buffer_pool_release (&command); ··· 297 298 298 299 bailout: 299 300 300 - if(unlink_newfile) 301 + if (unlink_newfile) 301 302 unlink(mutt_b2s (newfile)); 302 303 303 304 mutt_buffer_pool_release (&command); ··· 473 474 } 474 475 if (use_pipe && ((tempfd = open (mutt_b2s (tempfile), 0)) == -1)) 475 476 { 476 - if(pagerfd != -1) 477 + if (pagerfd != -1) 477 478 close(pagerfd); 478 479 mutt_perror ("open"); 479 480 goto return_error; ··· 482 483 if ((thepid = mutt_create_filter_fd (mutt_b2s (command), NULL, NULL, NULL, 483 484 use_pipe ? tempfd : -1, use_pager ? pagerfd : -1, -1)) == -1) 484 485 { 485 - if(pagerfd != -1) 486 + if (pagerfd != -1) 486 487 close(pagerfd); 487 488 488 - if(tempfd != -1) 489 + if (tempfd != -1) 489 490 close(tempfd); 490 491 491 492 mutt_error _("Cannot create filter"); ··· 740 741 741 742 /* recv mode */ 742 743 743 - if(hdr && 744 + if (hdr && 744 745 m->hdr && 745 746 m->encoding != ENCBASE64 && 746 747 m->encoding != ENCQUOTEDPRINTABLE &&
+9 -5
browser.c
··· 192 192 { 193 193 int do_locales = TRUE; 194 194 195 - if (op == 'D') { 195 + if (op == 'D') 196 + { 196 197 t_fmt = NONULL(DateFmt); 197 - if (*t_fmt == '!') { 198 + if (*t_fmt == '!') 199 + { 198 200 ++t_fmt; 199 201 do_locales = FALSE; 200 202 } 201 - } else { 203 + } 204 + else 205 + { 202 206 tnow = time (NULL); 203 207 t_fmt = tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y"; 204 208 } ··· 596 600 597 601 menu->max = state->entrylen; 598 602 599 - if(menu->current >= menu->max) 603 + if (menu->current >= menu->max) 600 604 menu->current = menu->max - 1; 601 605 if (menu->current < 0) 602 606 menu->current = 0; ··· 947 951 goto bail; 948 952 949 953 case OP_BROWSER_TELL: 950 - if(state.entrylen) 954 + if (state.entrylen) 951 955 mutt_message("%s", state.entry[menu->current].name); 952 956 break; 953 957
+6 -5
buffy.c
··· 260 260 mutt_extract_token (path, s, 0); 261 261 strfcpy (buf, path->data, sizeof (buf)); 262 262 263 - if(data == MUTT_UNMAILBOXES && mutt_strcmp(buf,"*") == 0) 263 + if (data == MUTT_UNMAILBOXES && mutt_strcmp(buf,"*") == 0) 264 264 { 265 265 for (tmp = &Incoming; *tmp;) 266 266 { ··· 280 280 mutt_expand_path (buf, sizeof (buf)); 281 281 282 282 /* Skip empty tokens. */ 283 - if(!*buf) continue; 283 + if (!*buf) continue; 284 284 285 285 /* avoid duplicates */ 286 286 p = realpath (buf, f1); ··· 293 293 } 294 294 } 295 295 296 - if(data == MUTT_UNMAILBOXES) 296 + if (data == MUTT_UNMAILBOXES) 297 297 { 298 - if(*tmp) 298 + if (*tmp) 299 299 { 300 300 tmp1=(*tmp)->next; 301 301 #ifdef USE_SIDEBAR ··· 310 310 continue; 311 311 } 312 312 313 - if (!*tmp) { 313 + if (!*tmp) 314 + { 314 315 *tmp = buffy_new (buf); 315 316 #ifdef USE_SIDEBAR 316 317 mutt_sb_notify_mailbox (*tmp, 1);
+2 -1
charset.c
··· 317 317 const char *c = AssumedCharset; 318 318 const char *c1; 319 319 320 - if (c && *c) { 320 + if (c && *c) 321 + { 321 322 c1 = strchr (c, ':'); 322 323 strfcpy (fcharset, c, c1 ? (c1 - c + 1) : sizeof (fcharset)); 323 324 return fcharset;
+17 -17
color.c
··· 132 132 { 133 133 COLOR_LINE *tmp; 134 134 135 - if(!l || !*l) 135 + if (!l || !*l) 136 136 return; 137 137 138 138 tmp = *l; 139 139 140 140 #ifdef HAVE_COLOR 141 - if(free_colors && tmp->fg != -1 && tmp->bg != -1) 141 + if (free_colors && tmp->fg != -1 && tmp->bg != -1) 142 142 mutt_free_color(tmp->fg, tmp->bg); 143 143 #endif 144 144 ··· 589 589 { 590 590 strfcpy(buf, NONULL(s), sizeof(buf)); 591 591 mutt_check_simple (buf, sizeof (buf), NONULL(SimpleSearch)); 592 - if((tmp->color_pattern = mutt_pattern_comp (buf, MUTT_FULL_MSG, err)) == NULL) 592 + if ((tmp->color_pattern = mutt_pattern_comp (buf, MUTT_FULL_MSG, err)) == NULL) 593 593 { 594 594 mutt_free_color_line(&tmp, 1); 595 595 return -1; ··· 604 604 tmp->next = *top; 605 605 tmp->pattern = safe_strdup (s); 606 606 #ifdef HAVE_COLOR 607 - if(fg != -1 && bg != -1) 607 + if (fg != -1 && bg != -1) 608 608 { 609 609 tmp->fg = fg; 610 610 tmp->bg = bg; ··· 633 633 int q_level = 0; 634 634 char *eptr; 635 635 636 - if(!MoreArgs(s)) 636 + if (!MoreArgs(s)) 637 637 { 638 638 strfcpy(err->data, _("Missing arguments."), err->dsize); 639 639 return -1; 640 640 } 641 641 642 642 mutt_extract_token(buf, s, 0); 643 - if(!mutt_strncmp(buf->data, "quoted", 6)) 643 + if (!mutt_strncmp(buf->data, "quoted", 6)) 644 644 { 645 - if(buf->data[6]) 645 + if (buf->data[6]) 646 646 { 647 647 *ql = strtol(buf->data + 6, &eptr, 10); 648 - if(*eptr || q_level < 0) 648 + if (*eptr || q_level < 0) 649 649 { 650 650 snprintf(err->data, err->dsize, _("%s: no such object"), buf->data); 651 651 return -1; ··· 719 719 parse_attr_spec(BUFFER *buf, BUFFER *s, int *fg, int *bg, int *attr, BUFFER *err) 720 720 { 721 721 722 - if(fg) *fg = -1; 723 - if(bg) *bg = -1; 722 + if (fg) *fg = -1; 723 + if (bg) *bg = -1; 724 724 725 725 if (! MoreArgs (s)) 726 726 { ··· 754 754 static int fgbgattr_to_color(int fg, int bg, int attr) 755 755 { 756 756 #ifdef HAVE_COLOR 757 - if(fg != -1 && bg != -1) 757 + if (fg != -1 && bg != -1) 758 758 return attr | mutt_alloc_color(fg, bg); 759 759 else 760 760 #endif ··· 772 772 int object = 0, attr = 0, fg = 0, bg = 0, q_level = 0; 773 773 int r = 0; 774 774 775 - if(parse_object(buf, s, &object, &q_level, err) == -1) 775 + if (parse_object(buf, s, &object, &q_level, err) == -1) 776 776 return -1; 777 777 778 - if(callback(buf, s, &fg, &bg, &attr, err) == -1) 778 + if (callback(buf, s, &fg, &bg, &attr, err) == -1) 779 779 return -1; 780 780 781 781 /* extract a regular expression if needed */ ··· 799 799 800 800 /* dry run? */ 801 801 802 - if(dry_run) return 0; 802 + if (dry_run) return 0; 803 803 804 804 805 805 #ifdef HAVE_COLOR ··· 860 860 { 861 861 int dry_run = 0; 862 862 863 - if(option(OPTNOCURSES) || !has_colors()) 863 + if (option(OPTNOCURSES) || !has_colors()) 864 864 dry_run = 1; 865 865 866 866 return _mutt_parse_color(buff, s, err, parse_color_pair, dry_run); ··· 873 873 int dry_run = 0; 874 874 875 875 #ifdef HAVE_COLOR 876 - if(option(OPTNOCURSES) || has_colors()) 876 + if (option(OPTNOCURSES) || has_colors()) 877 877 dry_run = 1; 878 878 #else 879 - if(option(OPTNOCURSES)) 879 + if (option(OPTNOCURSES)) 880 880 dry_run = 1; 881 881 #endif 882 882
+6 -6
commands.c
··· 155 155 { 156 156 if (cur->security & APPLICATION_SMIME) 157 157 crypt_smime_getkeys (cur->env); 158 - if(!crypt_valid_passphrase(cur->security)) 158 + if (!crypt_valid_passphrase(cur->security)) 159 159 return 0; 160 160 161 161 cmflags |= MUTT_CM_VERIFY; ··· 350 350 } 351 351 } 352 352 353 - if(h) 353 + if (h) 354 354 strfcpy(prompt, _("Bounce message to: "), sizeof(prompt)); 355 355 else 356 356 strfcpy(prompt, _("Bounce tagged messages to: "), sizeof(prompt)); ··· 437 437 438 438 if (WithCrypto && decode && h->security & ENCRYPT) 439 439 { 440 - if(!crypt_valid_passphrase(h->security)) 440 + if (!crypt_valid_passphrase(h->security)) 441 441 return; 442 442 endwin (); 443 443 } ··· 476 476 if (WithCrypto && decode) 477 477 { 478 478 mutt_parse_mime_message (Context, h); 479 - if(h->security & ENCRYPT && !crypt_valid_passphrase(h->security)) 479 + if (h->security & ENCRYPT && !crypt_valid_passphrase(h->security)) 480 480 return 1; 481 481 } 482 482 mutt_endwin (NULL); ··· 499 499 if (WithCrypto && decode) 500 500 { 501 501 for (i = 0; i < Context->vcount; i++) 502 - if(Context->hdrs[Context->v2r[i]]->tagged) 502 + if (Context->hdrs[Context->v2r[i]]->tagged) 503 503 { 504 504 mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], MUTT_MESSAGEHOOK); 505 505 mutt_parse_mime_message(Context, Context->hdrs[Context->v2r[i]]); ··· 684 684 { 685 685 if (!buf[0] && Shell) 686 686 strfcpy (buf, Shell, sizeof (buf)); 687 - if(buf[0]) 687 + if (buf[0]) 688 688 { 689 689 mutt_window_clearline (MuttMessageWindow, 0); 690 690 mutt_endwin (NULL);
+11 -11
compose.c
··· 317 317 for (i = 0; i < actx->idxlen; i++) 318 318 { 319 319 strfcpy(pretty, actx->idx[i]->content->filename, sizeof(pretty)); 320 - if(stat(actx->idx[i]->content->filename, &st) != 0) 320 + if (stat(actx->idx[i]->content->filename, &st) != 0) 321 321 { 322 322 mutt_pretty_mailbox(pretty, sizeof (pretty)); 323 323 mutt_error(_("%s [#%d] no longer exists!"), ··· 325 325 return -1; 326 326 } 327 327 328 - if(actx->idx[i]->content->stamp < st.st_mtime) 328 + if (actx->idx[i]->content->stamp < st.st_mtime) 329 329 { 330 330 mutt_pretty_mailbox(pretty, sizeof (pretty)); 331 331 snprintf(msg, sizeof(msg), _("%s [#%d] modified. Update encoding?"), 332 332 pretty, i+1); 333 333 334 - if((r = mutt_yesorno(msg, MUTT_YES)) == MUTT_YES) 334 + if ((r = mutt_yesorno(msg, MUTT_YES)) == MUTT_YES) 335 335 mutt_update_encoding(actx->idx[i]->content); 336 - else if(r == -1) 336 + else if (r == -1) 337 337 return -1; 338 338 } 339 339 } ··· 1120 1120 * users an opportunity to change settings from the ":" prompt. 1121 1121 */ 1122 1122 1123 - if(check_attachments(actx) != 0) 1123 + if (check_attachments(actx) != 0) 1124 1124 { 1125 1125 menu->redraw = REDRAW_FULL; 1126 1126 break; ··· 1162 1162 1163 1163 case OP_COMPOSE_GET_ATTACHMENT: 1164 1164 CHECK_COUNT; 1165 - if(menu->tagprefix) 1165 + if (menu->tagprefix) 1166 1166 { 1167 1167 BODY *top; 1168 - for(top = msg->content; top; top = top->next) 1168 + for (top = msg->content; top; top = top->next) 1169 1169 { 1170 - if(top->tagged) 1170 + if (top->tagged) 1171 1171 mutt_get_tmp_attachment(top); 1172 1172 } 1173 1173 menu->redraw = REDRAW_FULL; ··· 1219 1219 } 1220 1220 1221 1221 mutt_expand_path (fname, sizeof (fname)); 1222 - if(mutt_rename_file (CURATTACH->content->filename, fname)) 1222 + if (mutt_rename_file (CURATTACH->content->filename, fname)) 1223 1223 break; 1224 1224 1225 1225 mutt_str_replace (&CURATTACH->content->filename, fname); 1226 1226 menu->redraw = REDRAW_CURRENT; 1227 1227 1228 - if(CURATTACH->content->stamp >= st.st_mtime) 1228 + if (CURATTACH->content->stamp >= st.st_mtime) 1229 1229 mutt_stamp_attachment(CURATTACH->content); 1230 1230 1231 1231 } ··· 1364 1364 1365 1365 case OP_COMPOSE_POSTPONE_MESSAGE: 1366 1366 1367 - if(check_attachments(actx) != 0) 1367 + if (check_attachments(actx) != 0) 1368 1368 { 1369 1369 menu->redraw = REDRAW_FULL; 1370 1370 break;
+7 -4
copy.c
··· 247 247 if (!ignore) 248 248 { 249 249 dprint (2, (debugfile, "Reorder: x = %d; hdr_count = %d\n", x, hdr_count)); 250 - if (!this_one) { 250 + if (!this_one) 251 + { 251 252 this_one = safe_strdup (buf); 252 253 this_one_len = mutt_strlen (this_one); 253 - } else { 254 + } 255 + else 256 + { 254 257 int blen = mutt_strlen (buf); 255 258 256 259 safe_realloc (&this_one, this_one_len + blen + sizeof (char)); ··· 703 706 704 707 fputs(prefix, fpout); 705 708 706 - while((c = fgetc(fpin)) != EOF && bytes--) 709 + while ((c = fgetc(fpin)) != EOF && bytes--) 707 710 { 708 711 fputc(c, fpout); 709 - if(c == '\n') 712 + if (c == '\n') 710 713 { 711 714 fputs(prefix, fpout); 712 715 }
+19 -14
crypt-gpgme.c
··· 852 852 853 853 context = create_gpgme_context ((protocol == GPGME_PROTOCOL_CMS)); 854 854 s = keylist; 855 - do { 855 + do 856 + { 856 857 while (*s == ' ') 857 858 s++; 858 859 for (i=0; *s && *s != ' ' && i < sizeof(buf)-1;) ··· 1056 1057 /* convert GPGME raw hash name to RFC 2633 format */ 1057 1058 snprintf (buf, buflen, "%s", algorithm_name); 1058 1059 ascii_strlower (buf); 1059 - } else { 1060 + } 1061 + else 1062 + { 1060 1063 /* convert GPGME raw hash name to RFC 3156 format */ 1061 1064 snprintf (buf, buflen, "pgp-%s", algorithm_name); 1062 1065 ascii_strlower (buf + 4); ··· 1582 1585 if the S/MIME key has no ID. This is quite an error. 1583 1586 */ 1584 1587 state_puts (_("no signature fingerprint available"), s); 1585 - else { 1588 + else 1589 + { 1586 1590 state_puts (_("KeyID "), s); 1587 1591 state_puts (sig->fpr, s); 1588 1592 } ··· 1977 1981 1978 1982 if (maybe_signed) 1979 1983 a->is_signed_data = 1; 1980 - if(r_is_signed) 1984 + if (r_is_signed) 1981 1985 *r_is_signed = -1; /* A signature exists. */ 1982 1986 1983 1987 if ((s->flags & MUTT_DISPLAY)) 1984 1988 state_attach_puts (_("[-- Begin signature " 1985 1989 "information --]\n"), s); 1986 - for(idx = 0; (res = show_one_sig_status (ctx, idx, s)) != -1; idx++) 1990 + for (idx = 0; (res = show_one_sig_status (ctx, idx, s)) != -1; idx++) 1987 1991 { 1988 1992 if (res == 1) 1989 1993 anybad = 1; ··· 2766 2770 state_attach_puts (_("[-- Begin signature " 2767 2771 "information --]\n"), s); 2768 2772 have_any_sigs = 1; 2769 - for(idx=0; 2773 + for (idx=0; 2770 2774 (res = show_one_sig_status (ctx, idx, s)) != -1; 2771 2775 idx++) 2772 2776 { ··· 2802 2806 * seems to be a reasonable guess. 2803 2807 */ 2804 2808 2805 - if(s->flags & MUTT_DISPLAY) 2809 + if (s->flags & MUTT_DISPLAY) 2806 2810 { 2807 2811 if (needpass) 2808 2812 state_attach_puts (_("[-- BEGIN PGP MESSAGE --]\n\n"), s); ··· 4104 4108 size_t n; 4105 4109 4106 4110 n = 0; 4107 - for(l=list; l; l = l->next) 4111 + for (l=list; l; l = l->next) 4108 4112 { 4109 - for(s = l->data; *s; s++) 4113 + for (s = l->data; *s; s++) 4110 4114 { 4111 4115 if (*s == '%' || *s == '+') 4112 4116 n += 2; ··· 4116 4120 } 4117 4121 n++; /* make sure to allocate at least one byte */ 4118 4122 pattern = p = safe_calloc (1,n); 4119 - for(l=list; l; l = l->next) 4123 + for (l=list; l; l = l->next) 4120 4124 { 4121 4125 s = l->data; 4122 4126 if (*s) 4123 4127 { 4124 4128 if (l != list) 4125 4129 *p++ = ' '; 4126 - for(s = l->data; *s; s++) 4130 + for (s = l->data; *s; s++) 4127 4131 { 4128 4132 if (*s == '%') 4129 4133 { ··· 4178 4182 size_t n; 4179 4183 char **patarr; 4180 4184 4181 - for(l=hints, n=0; l; l = l->next) 4185 + for (l=hints, n=0; l; l = l->next) 4182 4186 { 4183 4187 if (l->data && *l->data) 4184 4188 n++; ··· 4187 4191 goto no_pgphints; 4188 4192 4189 4193 patarr = safe_calloc (n+1, sizeof *patarr); 4190 - for(l=hints, n=0; l; l = l->next) 4194 + for (l=hints, n=0; l; l = l->next) 4191 4195 { 4192 4196 if (l->data && *l->data) 4193 4197 patarr[n++] = safe_strdup (l->data); ··· 4985 4989 /* this initialization should only run one time, but it may be called by 4986 4990 * either pgp_gpgme_init or smime_gpgme_init */ 4987 4991 static bool has_run = 0; 4988 - if (!has_run) { 4992 + if (!has_run) 4993 + { 4989 4994 gpgme_check_version(NULL); 4990 4995 gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL)); 4991 4996 #ifdef ENABLE_NLS
+4 -4
crypt.c
··· 441 441 !ascii_strcasecmp (p, "keys-only")) 442 442 t |= PGPKEY; 443 443 444 - if(!t) t |= PGPENCRYPT; /* not necessarily correct, but... */ 444 + if (!t) t |= PGPENCRYPT; /* not necessarily correct, but... */ 445 445 } 446 446 447 447 if (!ascii_strcasecmp (m->subtype, "pgp-signed")) ··· 473 473 char *t=NULL; 474 474 int len, complain=0; 475 475 476 - if(!m) 476 + if (!m) 477 477 return 0; 478 478 479 479 if ((m->type & TYPEAPPLICATION) && m->subtype) ··· 665 665 else if (a->type == TYPEMESSAGE && 666 666 ascii_strcasecmp(a->subtype, "delivery-status")) 667 667 { 668 - if(a->encoding != ENC7BIT) 668 + if (a->encoding != ENC7BIT) 669 669 mutt_message_to_7bit (a, NULL); 670 670 } 671 671 else if (a->encoding == ENC8BIT) ··· 913 913 crypt_fetch_signatures (signatures, a->parts, n); 914 914 else 915 915 { 916 - if((*n % 5) == 0) 916 + if ((*n % 5) == 0) 917 917 safe_realloc (signatures, (*n + 6) * sizeof (BODY **)); 918 918 919 919 (*signatures)[(*n)++] = a;
+6 -3
curs_lib.c
··· 587 587 progress->flags = flags; 588 588 progress->msg = msg; 589 589 progress->size = size; 590 - if (progress->size) { 590 + if (progress->size) 591 + { 591 592 if (progress->flags & MUTT_PROGRESS_SIZE) 592 593 mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr), 593 594 progress->size); ··· 633 634 update = 1; 634 635 635 636 /* skip refresh if not enough time has passed */ 636 - if (update && progress->timestamp && !gettimeofday (&tv, NULL)) { 637 + if (update && progress->timestamp && !gettimeofday (&tv, NULL)) 638 + { 637 639 now = ((unsigned int) tv.tv_sec * 1000) 638 640 + (unsigned int) (tv.tv_usec / 1000); 639 641 if (now && now - progress->timestamp < TimeInc) ··· 1079 1081 else 1080 1082 SavedCursor = cursor; 1081 1083 1082 - if (curs_set (cursor) == ERR) { 1084 + if (curs_set (cursor) == ERR) 1085 + { 1083 1086 if (cursor == 1) /* cnorm */ 1084 1087 curs_set (2); /* cvvis */ 1085 1088 }
+8 -4
curs_main.c
··· 627 627 menu->custom_menu_redraw = index_menu_redraw; 628 628 mutt_push_current_menu (menu); 629 629 630 - if (!attach_msg) { 630 + if (!attach_msg) 631 + { 631 632 mutt_buffy_check(MUTT_BUFFY_CHECK_FORCE); /* force the buffy check after we 632 633 enter the folder */ 633 634 } ··· 699 700 menu_status_line(cmd, sizeof(cmd), menu, NONULL(NewMailCmd)); 700 701 mutt_system(cmd); 701 702 } 702 - } else if (check == MUTT_FLAGS) 703 + } 704 + else if (check == MUTT_FLAGS) 703 705 mutt_message _("Mailbox was externally modified."); 704 706 705 707 /* avoid the message being overwritten by buffy */ ··· 2211 2213 CHECK_MSGCOUNT; 2212 2214 CHECK_READONLY; 2213 2215 rc = mutt_label_message(tag ? NULL : CURHDR); 2214 - if (rc > 0) { 2216 + if (rc > 0) 2217 + { 2215 2218 Context->changed = 1; 2216 2219 menu->redraw = REDRAW_FULL; 2217 2220 /* L10N: This is displayed when the x-label on one or more 2218 2221 * messages is edited. */ 2219 2222 mutt_message (_("%d labels changed."), rc); 2220 2223 } 2221 - else { 2224 + else 2225 + { 2222 2226 /* L10N: This is displayed when editing an x-label, but no messages 2223 2227 * were updated. Possibly due to canceling at the prompt or if the new 2224 2228 * label is the same as the old label. */
+2 -1
doc/makedoc.c
··· 704 704 man_print_strval (val, out); 705 705 fputs ("\\(rq\n", out); 706 706 } 707 - else { 707 + else 708 + { 708 709 fputs ("Default: ", out); 709 710 man_print_strval (val, out); 710 711 fputs ("\n", out);
+2 -1
dotlock.c
··· 670 670 */ 671 671 672 672 t = time (NULL); 673 - do { 673 + do 674 + { 674 675 sleep (1); 675 676 } while (time (NULL) == t); 676 677 }
+2 -1
edit.c
··· 87 87 safe_realloc (&buf, sizeof (char *) * (*bufmax += 25)); 88 88 buf[(*buflen)++] = safe_strdup (tmp); 89 89 } 90 - if (buf && *bufmax == *buflen) { /* Do not smash memory past buf */ 90 + if (buf && *bufmax == *buflen) /* Do not smash memory past buf */ 91 + { 91 92 safe_realloc (&buf, sizeof (char *) * (++*bufmax)); 92 93 } 93 94 if (buf) buf[*buflen] = NULL;
+4 -2
enter.c
··· 93 93 break; 94 94 95 95 /* If this works, we can stop now */ 96 - if (dlen >= MB_LEN_MAX) { 96 + if (dlen >= MB_LEN_MAX) 97 + { 97 98 wcrtomb (dest, 0, &st); 98 99 return; 99 100 } ··· 109 110 p += wcrtomb (p, 0, &st); 110 111 111 112 /* If it fits into the destination buffer, we can stop now */ 112 - if (p - buf <= dlen) { 113 + if (p - buf <= dlen) 114 + { 113 115 memcpy (dest, buf, p - buf); 114 116 return; 115 117 }
+2 -2
gnupgparse.c
··· 339 339 case 12: /* key capabilities */ 340 340 dprint (2, (debugfile, "capabilities info: %s\n", p)); 341 341 342 - while(*p) 342 + while (*p) 343 343 { 344 - switch(*p++) 344 + switch (*p++) 345 345 { 346 346 case 'D': 347 347 flags |= KEYFLAG_DISABLED;
+10 -9
handler.c
··· 125 125 126 126 while ((c = fgetc(s->fpin)) != EOF && len--) 127 127 { 128 - if(c == '\r' && len) 128 + if (c == '\r' && len) 129 129 { 130 - if((ch = fgetc(s->fpin)) == '\n') 130 + if ((ch = fgetc(s->fpin)) == '\n') 131 131 { 132 132 c = ch; 133 133 len--; ··· 382 382 char bufi[BUFI_SIZE]; 383 383 size_t k = 0; 384 384 385 - if(istext) 385 + if (istext) 386 386 state_set_prefix(s); 387 387 388 - while(len > 0) 388 + while (len > 0) 389 389 { 390 390 if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL) 391 391 return; ··· 393 393 if ((!mutt_strncmp (tmps, "begin", 5)) && ISSPACE (tmps[5])) 394 394 break; 395 395 } 396 - while(len > 0) 396 + while (len > 0) 397 397 { 398 398 if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL) 399 399 return; ··· 971 971 LIST *t = AutoViewList; 972 972 973 973 mutt_check_lookup_list (b, type, sizeof (type)); 974 - for (; t; t = t->next) { 974 + for (; t; t = t->next) 975 + { 975 976 int i = mutt_strlen (t->data) - 1; 976 977 if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && 977 978 ascii_strncasecmp (type, t->data, i) == 0) || ··· 1346 1347 1347 1348 mutt_copy_bytes (s->fpin, fpin, a->length); 1348 1349 1349 - if(!piped) 1350 + if (!piped) 1350 1351 { 1351 1352 safe_fclose (&fpin); 1352 1353 thepid = mutt_create_filter (command, NULL, &fpout, &fperr); ··· 1493 1494 CH_DECODE , NULL); 1494 1495 } 1495 1496 } 1496 - else if(expiration && expire < time(NULL)) 1497 + else if (expiration && expire < time(NULL)) 1497 1498 { 1498 1499 if (s->flags & MUTT_DISPLAY) 1499 1500 { ··· 1782 1783 } 1783 1784 else if (b->type == TYPEMESSAGE) 1784 1785 { 1785 - if(mutt_is_message_type(b->type, b->subtype)) 1786 + if (mutt_is_message_type(b->type, b->subtype)) 1786 1787 handler = message_handler; 1787 1788 else if (!ascii_strcasecmp ("delivery-status", b->subtype)) 1788 1789 plaintext = 1;
+19 -9
hcache.c
··· 215 215 (*off) += sizeof (int); 216 216 } 217 217 218 - static inline int is_ascii (const char *p, size_t len) { 218 + static inline int is_ascii (const char *p, size_t len) 219 + { 219 220 register const char *s = p; 220 - while (s && (unsigned) (s - p) < len) { 221 + while (s && (unsigned) (s - p) < len) 222 + { 221 223 if ((*s & 0x80) != 0) 222 224 return 0; 223 225 s++; ··· 237 239 return d; 238 240 } 239 241 240 - if (convert && !is_ascii (c, size)) { 242 + if (convert && !is_ascii (c, size)) 243 + { 241 244 p = mutt_substrdup (c, c + size); 242 - if (mutt_convert_string (&p, Charset, "utf-8", 0) == 0) { 245 + if (mutt_convert_string (&p, Charset, "utf-8", 0) == 0) 246 + { 243 247 c = p; 244 248 size = mutt_strlen (c) + 1; 245 249 } ··· 276 280 277 281 *c = safe_malloc(size); 278 282 memcpy(*c, d + *off, size); 279 - if (convert && !is_ascii (*c, size)) { 283 + if (convert && !is_ascii (*c, size)) 284 + { 280 285 char *tmp = safe_strdup (*c); 281 - if (mutt_convert_string (&tmp, "utf-8", Charset, 0) == 0) { 286 + if (mutt_convert_string (&tmp, "utf-8", Charset, 0) == 0) 287 + { 282 288 mutt_str_replace (c, tmp); 283 - } else { 289 + } 290 + else 291 + { 284 292 FREE(&tmp); 285 293 } 286 294 } ··· 1003 1011 p = safe_malloc (PATH_MAX+1); 1004 1012 if (!realpath (path, p)) 1005 1013 mutt_str_replace (&p, path); 1006 - } else 1014 + } 1015 + else 1007 1016 p = safe_strdup (path); 1008 1017 1009 1018 return p; ··· 1466 1475 #endif 1467 1476 1468 1477 /* Calculate the current hcache version from dynamic configuration */ 1469 - if (hcachever == 0x0) { 1478 + if (hcachever == 0x0) 1479 + { 1470 1480 union { 1471 1481 unsigned char charval[16]; 1472 1482 unsigned int intval;
+5 -5
hdrline.c
··· 173 173 { 174 174 ENVELOPE *env = h->env; 175 175 176 - if(!h->recip_valid) 176 + if (!h->recip_valid) 177 177 { 178 178 h->recip_valid = 1; 179 179 ··· 280 280 switch (op) 281 281 { 282 282 case 'A': 283 - if(hdr->env->reply_to && hdr->env->reply_to->mailbox) 283 + if (hdr->env->reply_to && hdr->env->reply_to->mailbox) 284 284 { 285 285 mutt_format_s (dest, destlen, prefix, mutt_addr_for_display (hdr->env->reply_to)); 286 286 break; ··· 288 288 /* fall through if 'A' returns nothing */ 289 289 290 290 case 'a': 291 - if(hdr->env->from && hdr->env->from->mailbox) 291 + if (hdr->env->from && hdr->env->from->mailbox) 292 292 { 293 293 mutt_format_s (dest, destlen, prefix, mutt_addr_for_display (hdr->env->from)); 294 294 } ··· 309 309 /* fall through if 'B' returns nothing */ 310 310 311 311 case 'b': 312 - if(ctx) 312 + if (ctx) 313 313 { 314 314 if ((p = strrchr (ctx->path, '/'))) 315 315 strfcpy (dest, p + 1, destlen); ··· 504 504 break; 505 505 506 506 case 'm': 507 - if(ctx) 507 + if (ctx) 508 508 { 509 509 snprintf (fmt, sizeof (fmt), "%%%sd", prefix); 510 510 snprintf (dest, destlen, fmt, ctx->msgcount);
+9 -4
headers.c
··· 282 282 return 0; 283 283 284 284 *buf = '\0'; 285 - if (hdr != NULL && hdr->env->x_label != NULL) { 285 + if (hdr != NULL && hdr->env->x_label != NULL) 286 + { 286 287 strncpy(buf, hdr->env->x_label, LONG_STRING); 287 288 } 288 289 ··· 302 303 ++changed; 303 304 mutt_set_header_color (Context, hdr); 304 305 } 305 - } else { 306 + } 307 + else 308 + { 306 309 #define HDR_OF(index) Context->hdrs[Context->v2r[(index)]] 307 - for (i = 0; i < Context->vcount; ++i) { 310 + for (i = 0; i < Context->vcount; ++i) 311 + { 308 312 if (HDR_OF(i)->tagged) 309 - if (label_message(Context, HDR_OF(i), new)) { 313 + if (label_message(Context, HDR_OF(i), new)) 314 + { 310 315 ++changed; 311 316 mutt_set_flag(Context, HDR_OF(i), 312 317 MUTT_TAG, 0);
+2 -1
help.c
··· 351 351 if (!desc) 352 352 desc = _("<UNKNOWN>"); 353 353 354 - do { 354 + do 355 + { 355 356 if ((f = safe_fopen (t, "w")) == NULL) 356 357 { 357 358 mutt_perror (t);
+3 -3
history.c
··· 90 90 { 91 91 int i; 92 92 93 - if(OldSize) 93 + if (OldSize) 94 94 { 95 95 if (h->hist) 96 96 { ··· 224 224 } 225 225 226 226 if (!regen_file) 227 - for(hclass = HC_FIRST; hclass < HC_LAST; hclass++) 227 + for (hclass = HC_FIRST; hclass < HC_LAST; hclass++) 228 228 if (n[hclass] > SaveHist) 229 229 { 230 230 regen_file = 1; ··· 374 374 if (HistSize == OldSize) 375 375 return; 376 376 377 - for(hclass = HC_FIRST; hclass < HC_LAST; hclass++) 377 + for (hclass = HC_FIRST; hclass < HC_LAST; hclass++) 378 378 init_history(&History[hclass]); 379 379 380 380 OldSize = HistSize;
+7 -5
hook.c
··· 115 115 pattern.data = safe_strdup (path); 116 116 } 117 117 #ifdef USE_COMPRESSED 118 - else if (data & (MUTT_APPENDHOOK | MUTT_OPENHOOK | MUTT_CLOSEHOOK)) { 119 - if (mutt_comp_valid_command (command.data) == 0) { 118 + else if (data & (MUTT_APPENDHOOK | MUTT_OPENHOOK | MUTT_CLOSEHOOK)) 119 + { 120 + if (mutt_comp_valid_command (command.data) == 0) 121 + { 120 122 strfcpy (err->data, _("badly formatted command string"), err->dsize); 121 123 return -1; 122 124 } ··· 442 444 mutt_buffer_init (&token); 443 445 for (; tmp; tmp = tmp->next) 444 446 { 445 - if(!tmp->command) 447 + if (!tmp->command) 446 448 continue; 447 449 448 450 if (tmp->type & MUTT_FOLDERHOOK) ··· 496 498 memset (&cache, 0, sizeof (cache)); 497 499 for (hook = Hooks; hook; hook = hook->next) 498 500 { 499 - if(!hook->command) 501 + if (!hook->command) 500 502 continue; 501 503 502 504 if (hook->type & type) ··· 533 535 /* determine if a matching hook exists */ 534 536 for (hook = Hooks; hook; hook = hook->next) 535 537 { 536 - if(!hook->command) 538 + if (!hook->command) 537 539 continue; 538 540 539 541 if (hook->type & type)
+6 -3
imap/auth_sasl.c
··· 62 62 * 2. attempt sasl_client_start with only "AUTH=ANONYMOUS" capability 63 63 * 3. if sasl_client_start fails, fall through... */ 64 64 65 - if (mutt_account_getuser (&idata->conn->account)) { 65 + if (mutt_account_getuser (&idata->conn->account)) 66 + { 66 67 sasl_dispose (&saslconn); 67 68 return IMAP_AUTH_FAILURE; 68 69 } ··· 72 73 !ascii_strncmp (idata->conn->account.user, "anonymous", 9))) 73 74 rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen, 74 75 &mech); 75 - } else if (!ascii_strcasecmp ("login", method) && 76 - !strstr (NONULL (idata->capstr), "AUTH=LOGIN")) { 76 + } 77 + else if (!ascii_strcasecmp ("login", method) && 78 + !strstr (NONULL (idata->capstr), "AUTH=LOGIN")) 79 + { 77 80 /* do not use SASL login for regular IMAP login (#3556) */ 78 81 sasl_dispose (&saslconn); 79 82 return IMAP_AUTH_UNAVAIL;
+2 -1
imap/browse.c
··· 305 305 306 306 imap_fix_path (idata, newname, buf, sizeof (buf)); 307 307 308 - if (imap_rename_mailbox (idata, &mx, buf) < 0) { 308 + if (imap_rename_mailbox (idata, &mx, buf) < 0) 309 + { 309 310 mutt_error (_("Rename failed: %s"), imap_get_qualifier (idata->buf)); 310 311 mutt_sleep (1); 311 312 goto fail;
+2 -1
imap/command.c
··· 169 169 cmd = &idata->cmds[c]; 170 170 if (cmd->state == IMAP_CMD_NEW) 171 171 { 172 - if (!ascii_strncmp (idata->buf, cmd->seq, SEQLEN)) { 172 + if (!ascii_strncmp (idata->buf, cmd->seq, SEQLEN)) 173 + { 173 174 if (!stillrunning) 174 175 { 175 176 /* first command in queue has finished - move queue pointer up */
+11 -5
imap/imap.c
··· 155 155 char buf[LONG_STRING*2], mbox[LONG_STRING]; 156 156 IMAP_DATA *idata; 157 157 158 - if (!ctx || !ctx->data) { 158 + if (!ctx || !ctx->data) 159 + { 159 160 if (!(idata = imap_conn_find (&mx.account, 160 161 option (OPTIMAPPASSIVE) ? MUTT_IMAP_CONN_NONEW : 0))) 161 162 { 162 163 FREE (&mx.mbox); 163 164 return -1; 164 165 } 165 - } else { 166 + } 167 + else 168 + { 166 169 idata = ctx->data; 167 170 } 168 171 ··· 484 487 else if ((rc = query_quadoption (OPT_SSLSTARTTLS, 485 488 _("Secure connection with TLS?"))) == -1) 486 489 goto err_close_conn; 487 - if (rc == MUTT_YES) { 490 + if (rc == MUTT_YES) 491 + { 488 492 if ((rc = imap_exec (idata, "STARTTLS", IMAP_CMD_FAIL_OK)) == -1) 489 493 goto bail; 490 494 if (rc != -2) ··· 1186 1190 mutt_remove_trailing_ws (flags); 1187 1191 1188 1192 mutt_buffer_addstr (cmd, " -FLAGS.SILENT ("); 1189 - } else 1193 + } 1194 + else 1190 1195 mutt_buffer_addstr (cmd, " FLAGS.SILENT ("); 1191 1196 1192 1197 mutt_buffer_addstr (cmd, flags); ··· 2146 2151 2147 2152 /* imap_complete: given a partial IMAP folder path, return a string which 2148 2153 * adds as much to the path as is unique */ 2149 - int imap_complete(char* dest, size_t dlen, char* path) { 2154 + int imap_complete(char* dest, size_t dlen, char* path) 2155 + { 2150 2156 IMAP_DATA* idata; 2151 2157 char list[LONG_STRING]; 2152 2158 char buf[LONG_STRING*2];
+1 -1
imap/message.c
··· 1136 1136 * Ideally we'd have a HEADER structure with flag info here... */ 1137 1137 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c) 1138 1138 { 1139 - if(c == '\n' && last != '\r') 1139 + if (c == '\n' && last != '\r') 1140 1140 len++; 1141 1141 1142 1142 len++;
+9 -5
imap/util.c
··· 358 358 return -1; 359 359 } 360 360 361 - if (n > 1) { 361 + if (n > 1) 362 + { 362 363 if (sscanf (tmp, ":%hu%127s", &(mx->account.port), tmp) >= 1) 363 364 mx->account.flags |= MUTT_ACCT_PORT; 364 365 if (sscanf (tmp, "/%s", tmp) == 1) ··· 441 442 } 442 443 443 444 /* do the '=' substitution */ 444 - if (home_match) { 445 + if (home_match) 446 + { 445 447 *path++ = '='; 446 448 /* copy remaining path, skipping delimiter */ 447 449 if (! hlen) ··· 619 621 { 620 622 int quoted = 0; 621 623 622 - while (*s) { 623 - if (*s == '\\') { 624 + while (*s) 625 + { 626 + if (*s == '\\') 627 + { 624 628 s++; 625 629 if (*s) 626 630 s++; ··· 844 848 int i; 845 849 846 850 tmp[SHORT_STRING-1] = 0; 847 - for(i=0;i < SHORT_STRING-2;i++,s++) 851 + for (i=0;i < SHORT_STRING-2;i++,s++) 848 852 { 849 853 if (!*s || ISSPACE(*s)) 850 854 {
+32 -17
init.c
··· 231 231 int line = 0; 232 232 233 233 pc = tok->dptr; 234 - do { 234 + do 235 + { 235 236 if ((pc = strpbrk (pc, "\\`"))) 236 237 { 237 238 /* skip any quoted chars */ ··· 790 791 } 791 792 mutt_extract_token(&templ, s, 0); 792 793 793 - if (add_to_replace_list(list, buf->data, templ.data, err) != 0) { 794 + if (add_to_replace_list(list, buf->data, templ.data, err) != 0) 795 + { 794 796 FREE(&templ.data); 795 797 return -1; 796 798 } ··· 885 887 mutt_extract_token (&templ, s, 0); 886 888 887 889 /* Add to the spam list. */ 888 - if (add_to_replace_list (&SpamList, buf->data, templ.data, err) != 0) { 890 + if (add_to_replace_list (&SpamList, buf->data, templ.data, err) != 0) 891 + { 889 892 FREE(&templ.data); 890 893 return -1; 891 894 } ··· 1238 1241 /* We must do our own walk here because remove_from_list() will only 1239 1242 * remove the LIST->data, not anything pointed to by the LIST->data. */ 1240 1243 lastp = NULL; 1241 - for(lp = *ldata; lp; ) 1244 + for (lp = *ldata; lp; ) 1242 1245 { 1243 1246 a = (ATTACH_MATCH *)lp->data; 1244 1247 dprint(5, (debugfile, "parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n", ··· 1277 1280 1278 1281 static int print_attach_list (LIST *lp, char op, char *name) 1279 1282 { 1280 - while (lp) { 1283 + while (lp) 1284 + { 1281 1285 printf("attachments %c%s %s/%s\n", op, name, 1282 1286 ((ATTACH_MATCH *)lp->data)->major, 1283 1287 ((ATTACH_MATCH *)lp->data)->minor); ··· 1294 1298 LIST **listp; 1295 1299 1296 1300 mutt_extract_token(buf, s, 0); 1297 - if (!buf->data || *buf->data == '\0') { 1301 + if (!buf->data || *buf->data == '\0') 1302 + { 1298 1303 strfcpy(err->data, _("attachments: no disposition"), err->dsize); 1299 1304 return -1; 1300 1305 } ··· 1302 1307 category = buf->data; 1303 1308 op = *category++; 1304 1309 1305 - if (op == '?') { 1310 + if (op == '?') 1311 + { 1306 1312 mutt_endwin (NULL); 1307 1313 fflush (stdout); 1308 1314 printf("\nCurrent attachments settings:\n\n"); ··· 1314 1320 return 0; 1315 1321 } 1316 1322 1317 - if (op != '+' && op != '-') { 1323 + if (op != '+' && op != '-') 1324 + { 1318 1325 op = '+'; 1319 1326 category--; 1320 1327 } 1321 - if (!ascii_strncasecmp(category, "attachment", strlen(category))) { 1328 + if (!ascii_strncasecmp(category, "attachment", strlen(category))) 1329 + { 1322 1330 if (op == '+') 1323 1331 listp = &AttachAllow; 1324 1332 else 1325 1333 listp = &AttachExclude; 1326 1334 } 1327 - else if (!ascii_strncasecmp(category, "inline", strlen(category))) { 1335 + else if (!ascii_strncasecmp(category, "inline", strlen(category))) 1336 + { 1328 1337 if (op == '+') 1329 1338 listp = &InlineAllow; 1330 1339 else 1331 1340 listp = &InlineExclude; 1332 1341 } 1333 - else { 1342 + else 1343 + { 1334 1344 strfcpy(err->data, _("attachments: invalid disposition"), err->dsize); 1335 1345 return -1; 1336 1346 } ··· 1344 1354 LIST **listp; 1345 1355 1346 1356 mutt_extract_token(buf, s, 0); 1347 - if (!buf->data || *buf->data == '\0') { 1357 + if (!buf->data || *buf->data == '\0') 1358 + { 1348 1359 strfcpy(err->data, _("unattachments: no disposition"), err->dsize); 1349 1360 return -1; 1350 1361 } 1351 1362 1352 1363 p = buf->data; 1353 1364 op = *p++; 1354 - if (op != '+' && op != '-') { 1365 + if (op != '+' && op != '-') 1366 + { 1355 1367 op = '+'; 1356 1368 p--; 1357 1369 } 1358 - if (!ascii_strncasecmp(p, "attachment", strlen(p))) { 1370 + if (!ascii_strncasecmp(p, "attachment", strlen(p))) 1371 + { 1359 1372 if (op == '+') 1360 1373 listp = &AttachAllow; 1361 1374 else 1362 1375 listp = &AttachExclude; 1363 1376 } 1364 - else if (!ascii_strncasecmp(p, "inline", strlen(p))) { 1377 + else if (!ascii_strncasecmp(p, "inline", strlen(p))) 1378 + { 1365 1379 if (op == '+') 1366 1380 listp = &InlineAllow; 1367 1381 else 1368 1382 listp = &InlineExclude; 1369 1383 } 1370 - else { 1384 + else 1385 + { 1371 1386 strfcpy(err->data, _("unattachments: invalid disposition"), err->dsize); 1372 1387 return -1; 1373 1388 } ··· 1845 1860 if (!len) 1846 1861 return 0; 1847 1862 len--; /* save room for \0 */ 1848 - #define ESC_CHAR(C) do { *p++ = '\\'; if (p - dst < len) *p++ = C; } while(0) 1863 + #define ESC_CHAR(C) do { *p++ = '\\'; if (p - dst < len) *p++ = C; } while (0) 1849 1864 while (p - dst < len && src && *src) 1850 1865 { 1851 1866 switch (*src)
+11 -9
keymap.c
··· 149 149 char *t; 150 150 int n = 0; 151 151 152 - if(s[0] != '<' || ascii_tolower(s[1]) != 'f') 152 + if (s[0] != '<' || ascii_tolower(s[1]) != 'f') 153 153 return -1; 154 154 155 - for(t = s + 2; *t && isdigit((unsigned char) *t); t++) 155 + for (t = s + 2; *t && isdigit((unsigned char) *t); t++) 156 156 { 157 157 n *= 10; 158 158 n += *t - '0'; 159 159 } 160 160 161 - if(*t != '>') 161 + if (*t != '>') 162 162 return -1; 163 163 else 164 164 return n; ··· 176 176 while (ISSPACE(*endChar)) 177 177 ++endChar; 178 178 /* negative keycodes don't make sense, also detect overflow */ 179 - if (*endChar != '>' || result < 0 || result == LONG_MAX) { 179 + if (*endChar != '>' || result < 0 || result == LONG_MAX) 180 + { 180 181 return -1; 181 182 } 182 183 ··· 196 197 while (*s && len) 197 198 { 198 199 *d = '\0'; 199 - if(*s == '<' && (t = strchr(s, '>'))) 200 + if (*s == '<' && (t = strchr(s, '>'))) 200 201 { 201 202 t++; c = *t; *t = '\0'; 202 203 ··· 219 220 *t = c; 220 221 } 221 222 222 - if(!*d) 223 + if (!*d) 223 224 { 224 225 *d = (unsigned char)*s; 225 226 s++; ··· 1154 1155 } 1155 1156 nops++; 1156 1157 } 1157 - while(MoreArgs(s) && nops < sizeof(ops)/sizeof(ops[0])); 1158 + while (MoreArgs(s) && nops < sizeof(ops)/sizeof(ops[0])); 1158 1159 1159 - while(nops) 1160 + while (nops) 1160 1161 mutt_push_macro_event (0, ops[--nops]); 1161 1162 1162 1163 return 0; ··· 1171 1172 int ch; 1172 1173 1173 1174 mutt_window_mvprintw (MuttMessageWindow, 0, 0, _("Enter keys (^G to abort): ")); 1174 - do { 1175 + do 1176 + { 1175 1177 ch = getch(); 1176 1178 if (ch != ERR && ch != ctrl ('G')) 1177 1179 {
+15 -12
lib.c
··· 400 400 { 401 401 struct stat osb, nsb; 402 402 403 - if(!oldpath || !newpath) 403 + if (!oldpath || !newpath) 404 404 return -1; 405 405 406 - if(unlink(newpath) == -1 && errno != ENOENT) 406 + if (unlink(newpath) == -1 && errno != ENOENT) 407 407 return -1; 408 408 409 409 if (oldpath[0] == '/') ··· 425 425 return -1; 426 426 } 427 427 428 - if(stat(oldpath, &osb) == -1 || stat(newpath, &nsb) == -1 429 - || compare_stat(&osb, &nsb) == -1) 428 + if (stat(oldpath, &osb) == -1 || stat(newpath, &nsb) == -1 429 + || compare_stat(&osb, &nsb) == -1) 430 430 { 431 431 unlink(newpath); 432 432 return -1; ··· 866 866 { 867 867 size_t i, j = 0; 868 868 869 - if(!f) 869 + if (!f) 870 870 { 871 871 *d = '\0'; 872 872 return 0; ··· 877 877 878 878 d[j++] = '\''; 879 879 880 - for(i = 0; j < l && f[i]; i++) 880 + for (i = 0; j < l && f[i]; i++) 881 881 { 882 - if(f[i] == '\'' || f[i] == '`') 882 + if (f[i] == '\'' || f[i] == '`') 883 883 { 884 884 d[j++] = '\''; 885 885 d[j++] = '\\'; ··· 983 983 req = dirlen + fnamelen + 1; /* +1 for the trailing nul */ 984 984 if (dirlen && fnamelen) 985 985 req++; /* when both components are non-nul, we add a "/" in between */ 986 - if (req > dstlen) { /* check for condition where the dst length is too short */ 986 + if (req > dstlen) /* check for condition where the dst length is too short */ 987 + { 987 988 /* Two options here: 988 989 * 1) assert(0) or return NULL to signal error 989 990 * 2) copy as much of the path as will fit ··· 994 995 return NULL; 995 996 } 996 997 997 - if (dirlen) { /* when dir is not empty */ 998 + if (dirlen) /* when dir is not empty */ 999 + { 998 1000 memcpy(dst, dir, dirlen); 999 1001 offset = dirlen; 1000 1002 if (fnamelen) 1001 1003 dst[offset++] = '/'; 1002 1004 } 1003 - if (fnamelen) { /* when fname is not empty */ 1005 + if (fnamelen) /* when fname is not empty */ 1006 + { 1004 1007 memcpy(dst + offset, fname, fnamelen); 1005 1008 offset += fnamelen; 1006 1009 } ··· 1033 1036 { 1034 1037 int i; 1035 1038 1036 - for(i = 0; sysexits_h[i].str; i++) 1039 + for (i = 0; sysexits_h[i].str; i++) 1037 1040 { 1038 - if(e == sysexits_h[i].v) 1041 + if (e == sysexits_h[i].v) 1039 1042 break; 1040 1043 } 1041 1044
+1 -1
lib.h
··· 150 150 151 151 void mutt_debug (FILE *, const char *, ...); 152 152 153 - # define dprint(N,X) do { if(debuglevel>=N && debugfile) mutt_debug X; } while (0) 153 + # define dprint(N,X) do { if (debuglevel>=N && debugfile) mutt_debug X; } while (0) 154 154 155 155 # else 156 156
+3 -3
main.c
··· 633 633 634 634 /* sanity check against stupid administrators */ 635 635 636 - if(getegid() != getgid()) 636 + if (getegid() != getgid()) 637 637 { 638 638 fprintf(stderr, "%s: I don't want to run with privileges!\n", 639 639 argv[0]); ··· 1315 1315 1316 1316 mutt_folder_hook (folder); 1317 1317 1318 - if((Context = mx_open_mailbox (folder, ((flags & MUTT_RO) || option (OPTREADONLY)) ? MUTT_READONLY : 0, NULL)) 1319 - || !explicit_folder) 1318 + if ((Context = mx_open_mailbox (folder, ((flags & MUTT_RO) || option (OPTREADONLY)) ? MUTT_READONLY : 0, NULL)) 1319 + || !explicit_folder) 1320 1320 { 1321 1321 #ifdef USE_SIDEBAR 1322 1322 mutt_sb_set_open_buffy ();
+5 -4
mbox.c
··· 201 201 if (hdr->content->length < 0) 202 202 { 203 203 lines = -1; 204 - do { 204 + do 205 + { 205 206 loc = ftello (ctx->fp); 206 207 if (fgets (buf, sizeof (buf) - 1, ctx->fp) == NULL) 207 208 break; ··· 997 998 newOffset[i - first].body = ftello (fp) - ctx->hdrs[i]->content->length + offset; 998 999 mutt_free_body (&ctx->hdrs[i]->content->parts); 999 1000 1000 - switch(ctx->magic) 1001 + switch (ctx->magic) 1001 1002 { 1002 1003 case MUTT_MMDF: 1003 - if(fputs(MMDF_SEP, fp) == EOF) 1004 + if (fputs(MMDF_SEP, fp) == EOF) 1004 1005 { 1005 1006 mutt_perror (tempfile); 1006 1007 mutt_sleep (5); ··· 1009 1010 } 1010 1011 break; 1011 1012 default: 1012 - if(fputs("\n", fp) == EOF) 1013 + if (fputs("\n", fp) == EOF) 1013 1014 { 1014 1015 mutt_perror (tempfile); 1015 1016 mutt_sleep (5);
+8 -4
mh.c
··· 1121 1121 * likely be at the head of the list. but it is present for consistency with 1122 1122 * the check at the top of the for() loop in maildir_delayed_parsing(). 1123 1123 */ 1124 - while (!p->h || p->header_parsed) { 1124 + while (!p->h || p->header_parsed) 1125 + { 1125 1126 *last = p; 1126 1127 p = p->next; 1127 1128 } ··· 1150 1151 #endif 1151 1152 1152 1153 #if HAVE_DIRENT_D_INO 1153 - #define DO_SORT() do { \ 1154 + #define DO_SORT() \ 1155 + do \ 1156 + { \ 1154 1157 if (!sort) \ 1155 1158 { \ 1156 1159 dprint (4, (debugfile, "maildir: need to sort %s by inode\n", ctx->path)); \ ··· 1163 1166 p = skip_duplicates (p, &last); \ 1164 1167 mutt_buffer_printf (fn, "%s/%s", ctx->path, p->h->path); \ 1165 1168 } \ 1166 - } while(0) 1169 + } while (0) 1167 1170 #else 1168 1171 #define DO_SORT() /* nothing */ 1169 1172 #endif ··· 2660 2663 2661 2664 realpath = mutt_buffer_pool_get (); 2662 2665 2663 - do { 2666 + do 2667 + { 2664 2668 /* we do "cur" on the first iteration since its more likely that we'll 2665 2669 * find old messages without having to scan both subdirs 2666 2670 */
+5 -3
mutt_sasl.c
··· 37 37 { 38 38 int err; 39 39 dprint (1, (debugfile, "getnameinfo: ")); 40 - switch(ret) 40 + switch (ret) 41 41 { 42 42 case EAI_AGAIN: 43 43 dprint (1, (debugfile, "The name could not be resolved at this time. Future attempts may succeed.\n")); ··· 198 198 } 199 199 200 200 size = sizeof (local); 201 - if (!getsockname (conn->fd, (struct sockaddr *)&local, &size)) { 201 + if (!getsockname (conn->fd, (struct sockaddr *)&local, &size)) 202 + { 202 203 if (iptostring((struct sockaddr *)&local, size, iplocalport, 203 204 IP_PORT_BUFLEN) == SASL_OK) 204 205 plp = iplocalport; ··· 209 210 dprint (2, (debugfile, "SASL failed to get local IP address\n")); 210 211 211 212 size = sizeof (remote); 212 - if (!getpeername (conn->fd, (struct sockaddr *)&remote, &size)){ 213 + if (!getpeername (conn->fd, (struct sockaddr *)&remote, &size)) 214 + { 213 215 if (iptostring((struct sockaddr *)&remote, size, ipremoteport, 214 216 IP_PORT_BUFLEN) == SASL_OK) 215 217 prp = ipremoteport;
+2 -1
mutt_socket.c
··· 577 577 FREE (&host_idna); 578 578 # endif 579 579 580 - if (! he) { 580 + if (! he) 581 + { 581 582 mutt_error (_("Could not find the host \"%s\""), conn->account.host); 582 583 583 584 return -1;
+8 -4
mutt_ssl.c
··· 243 243 244 244 ssl_get_client_cert(ssldata, conn); 245 245 246 - if (SslCiphers) { 247 - if (!SSL_CTX_set_cipher_list (ssldata->ctx, SslCiphers)) { 246 + if (SslCiphers) 247 + { 248 + if (!SSL_CTX_set_cipher_list (ssldata->ctx, SslCiphers)) 249 + { 248 250 dprint (1, (debugfile, "mutt_ssl_starttls: Could not select preferred ciphers\n")); 249 251 goto bail_ctx; 250 252 } ··· 503 505 504 506 ssl_get_client_cert(data, conn); 505 507 506 - if (SslCiphers) { 508 + if (SslCiphers) 509 + { 507 510 SSL_CTX_set_cipher_list (data->ctx, SslCiphers); 508 511 } 509 512 ··· 1012 1015 /* cast is safe since bufsize is incremented above, so bufsize-1 is always 1013 1016 * zero or greater. 1014 1017 */ 1015 - if (mutt_strlen(buf) == (size_t)bufsize - 1) { 1018 + if (mutt_strlen(buf) == (size_t)bufsize - 1) 1019 + { 1016 1020 match_found = hostname_match(hostname_ascii, buf); 1017 1021 } 1018 1022 }
+17 -9
mutt_ssl_gnutls.c
··· 140 140 return -1; 141 141 } 142 142 143 - do { 143 + do 144 + { 144 145 ret = gnutls_record_recv (data->state, buf, len); 145 146 if (ret < 0 && gnutls_error_is_fatal(ret) == 1) 146 147 { ··· 425 426 mutt_sleep (1); 426 427 } 427 428 428 - if (tls_set_priority(data) < 0) { 429 + if (tls_set_priority(data) < 0) 430 + { 429 431 goto fail; 430 432 } 431 433 ··· 446 448 { 447 449 err = gnutls_handshake(data->state); 448 450 } 449 - if (err < 0) { 451 + if (err < 0) 452 + { 450 453 if (err == GNUTLS_E_FATAL_ALERT_RECEIVED) 451 454 { 452 455 mutt_error("gnutls_handshake: %s(%s)", gnutls_strerror(err), ··· 469 472 470 473 tls_get_client_cert (conn); 471 474 472 - if (!option(OPTNOCURSES)) { 475 + if (!option(OPTNOCURSES)) 476 + { 473 477 mutt_message (_("SSL/TLS connection using %s (%s/%s/%s)"), 474 478 gnutls_protocol_get_name (gnutls_protocol_get_version (data->state)), 475 479 gnutls_kx_get_name (gnutls_kx_get (data->state)), ··· 544 548 b64_data.data = b64_data_data; 545 549 546 550 fd1 = fopen(SslCertFile, "r"); 547 - if (fd1 == NULL) { 551 + if (fd1 == NULL) 552 + { 548 553 return 0; 549 554 } 550 555 551 556 b64_data.size = fread(b64_data.data, 1, b64_data.size, fd1); 552 557 safe_fclose (&fd1); 553 558 554 - do { 559 + do 560 + { 555 561 ret = gnutls_pem_base64_decode_alloc(NULL, &b64_data, &cert); 556 562 if (ret != 0) 557 563 { ··· 656 662 tls_fingerprint (GNUTLS_DIG_MD5, buf, sizeof (buf), cert); 657 663 while ((linestr = mutt_read_line(linestr, &linestrsize, fp, &linenum, 0)) != NULL) 658 664 { 659 - if(linestr[0] == '#' && linestr[1] == 'H') 665 + if (linestr[0] == '#' && linestr[1] == 'H') 660 666 { 661 667 if (regexec(&preg, linestr, 3, pmatch, 0) == 0) 662 668 { ··· 1143 1149 * from most specific to least checking these. If we see a saved certificate, 1144 1150 * its status short-circuits the remaining checks. */ 1145 1151 preauthrc = 0; 1146 - for (i = 0; i < cert_list_size; i++) { 1152 + for (i = 0; i < cert_list_size; i++) 1153 + { 1147 1154 rc = tls_check_preauth(&cert_list[i], certstat, conn->account.host, i, 1148 1155 &certerr, &savedcert); 1149 1156 preauthrc += rc; ··· 1171 1178 i, cert_list_size); 1172 1179 1173 1180 /* add signers to trust set, then reverify */ 1174 - if (i && rc) { 1181 + if (i && rc) 1182 + { 1175 1183 rc = gnutls_certificate_set_x509_trust_mem (data->xcred, &cert_list[i], 1176 1184 GNUTLS_X509_FMT_DER); 1177 1185 if (rc != 1)
+12 -8
muttlib.c
··· 377 377 378 378 void mutt_free_header (HEADER **h) 379 379 { 380 - if(!h || !*h) return; 380 + if (!h || !*h) return; 381 381 mutt_free_envelope (&(*h)->env); 382 382 mutt_free_body (&(*h)->content); 383 383 FREE (&(*h)->maildir_flags); ··· 669 669 return; 670 670 } 671 671 672 - for(q = *p; q; q = q->next) 672 + for (q = *p; q; q = q->next) 673 673 { 674 674 if (ascii_strcasecmp (attribute, q->attribute) == 0) 675 675 { ··· 712 712 break; 713 713 714 714 case TYPEAPPLICATION: 715 - if((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(m)) 715 + if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(m)) 716 716 return 0; 717 - if((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(m)) 717 + if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(m)) 718 718 return 0; 719 719 break; 720 720 ··· 1280 1280 command = mutt_buffer_new (); 1281 1281 1282 1282 /* Iterate expansions across successive arguments */ 1283 - do { 1283 + do 1284 + { 1284 1285 char *p; 1285 1286 1286 1287 /* Extract the command name and copy to command line */ ··· 1321 1322 rc = mutt_wait_filter(pid); 1322 1323 if (rc != 0) 1323 1324 dprint(1, (debugfile, "format pipe command exited code %d\n", rc)); 1324 - if (n > 0) { 1325 + if (n > 0) 1326 + { 1325 1327 dest[n] = 0; 1326 1328 while ((n > 0) && (dest[n-1] == '\n' || dest[n-1] == '\r')) 1327 1329 dest[--n] = '\0'; ··· 2057 2059 /* Ensure that the integer conversion succeeded (e!=p) and bounds check. The upper bound check 2058 2060 * should not strictly be necessary since add_to_spam_list() finds the largest value, and 2059 2061 * the static array above is always large enough based on that value. */ 2060 - if (e != p && n >= 0 && n <= l->nmatch && pmatch[n].rm_so != -1) { 2062 + if (e != p && n >= 0 && n <= l->nmatch && pmatch[n].rm_so != -1) 2063 + { 2061 2064 /* copy as much of the substring match as will fit in the output buffer, saving space for 2062 2065 * the terminating nul char */ 2063 2066 int idx; ··· 2076 2079 * terminal nul char. This should avoid returning an unterminated 2077 2080 * string to the caller. When textsize<=0 we make no assumption about 2078 2081 * the validity of the text pointer. */ 2079 - if (tlen < textsize) { 2082 + if (tlen < textsize) 2083 + { 2080 2084 text[tlen] = '\0'; 2081 2085 dprint (5, (debugfile, "mutt_match_spam_list: \"%s\"\n", text)); 2082 2086 }
+4 -4
mx.c
··· 150 150 151 151 snprintf(msg, sizeof(msg), _("Lock count exceeded, remove lock for %s?"), 152 152 path); 153 - if(retry && mutt_yesorno(msg, MUTT_YES) == MUTT_YES) 153 + if (retry && mutt_yesorno(msg, MUTT_YES) == MUTT_YES) 154 154 { 155 155 flags |= DL_FL_FORCE; 156 156 retry--; ··· 386 386 FILE *f; 387 387 388 388 #ifdef USE_IMAP 389 - if(mx_is_imap(path)) 389 + if (mx_is_imap(path)) 390 390 return MUTT_IMAP; 391 391 #endif /* USE_IMAP */ 392 392 ··· 677 677 struct utimbuf ut; 678 678 #endif /* HAVE_UTIMENSAT */ 679 679 680 - if(!ctx) 680 + if (!ctx) 681 681 return; 682 682 683 683 /* fix up the times so buffy won't get confused */ ··· 1300 1300 msg->received = hdr->received; 1301 1301 } 1302 1302 1303 - if(msg->received == 0) 1303 + if (msg->received == 0) 1304 1304 time(&msg->received); 1305 1305 1306 1306 if (dest->mx_ops->open_new_msg (msg, dest, hdr) == 0)
+11 -6
pager.c
··· 76 76 } 77 77 78 78 #define CHECK_ATTACH \ 79 - if(option(OPTATTACHMSG)) \ 79 + if (option(OPTATTACHMSG)) \ 80 80 { \ 81 81 mutt_flushinp (); \ 82 82 mutt_error _(Function_not_permitted_in_attach_message_mode); \ ··· 1996 1996 1997 1997 pager_menu_redraw (pager_menu); 1998 1998 1999 - if (option(OPTBRAILLEFRIENDLY)) { 2000 - if (brailleLine!=-1) { 1999 + if (option(OPTBRAILLEFRIENDLY)) 2000 + { 2001 + if (brailleLine!=-1) 2002 + { 2001 2003 move(brailleLine+1, 0); 2002 2004 brailleLine = -1; 2003 2005 } 2004 - } else 2006 + } 2007 + else 2005 2008 mutt_window_move (rd.pager_status_window, 0, rd.pager_status_window->cols-1); 2006 2009 2007 2010 mutt_refresh (); ··· 2851 2854 case OP_EDIT_LABEL: 2852 2855 CHECK_MODE(IsHeader (extra)); 2853 2856 rc = mutt_label_message(extra->hdr); 2854 - if (rc > 0) { 2857 + if (rc > 0) 2858 + { 2855 2859 Context->changed = 1; 2856 2860 pager_menu->redraw = REDRAW_FULL; 2857 2861 mutt_message (_("%d labels changed."), rc); 2858 2862 } 2859 - else { 2863 + else 2864 + { 2860 2865 mutt_message _("No labels changed."); 2861 2866 } 2862 2867 break;
+10 -7
parse.c
··· 183 183 s++; 184 184 for (i=0; *s && i < sizeof (buffer) - 1; i++, s++) 185 185 { 186 - if (AssumedCharset && *AssumedCharset) { 186 + if (AssumedCharset && *AssumedCharset) 187 + { 187 188 /* As iso-2022-* has a character of '"' with non-ascii state, 188 189 * ignore it. */ 189 190 if (*s == 0x1b && i < sizeof (buffer) - 2) ··· 324 325 if ((subtype = strchr(s, '/'))) 325 326 { 326 327 *subtype++ = '\0'; 327 - for(pc = subtype; *pc && !ISSPACE(*pc) && *pc != ';'; pc++) 328 + for (pc = subtype; *pc && !ISSPACE(*pc) && *pc != ';'; pc++) 328 329 ; 329 330 *pc = '\0'; 330 331 ct->subtype = safe_strdup (subtype); ··· 635 636 new = mutt_read_mime_header (fp, digest); 636 637 637 638 #ifdef SUN_ATTACHMENT 638 - if (mutt_get_parameter ("content-lines", new->parameter)) { 639 + if (mutt_get_parameter ("content-lines", new->parameter)) 640 + { 639 641 mutt_atoi (mutt_get_parameter ("content-lines", new->parameter), &lines); 640 642 for ( ; lines; lines-- ) 641 643 if (ftello (fp) >= end_off || fgets (buffer, LONG_STRING, fp) == NULL) ··· 648 650 * bad attachment end boundaries 649 651 */ 650 652 651 - if(new->offset > end_off) 653 + if (new->offset > end_off) 652 654 { 653 655 mutt_free_body(&new); 654 656 break; ··· 669 671 last->length = end_off - last->offset; 670 672 671 673 /* parse recursive MIME parts */ 672 - for(last = head; last; last = last->next) 674 + for (last = head; last; last = last->next) 673 675 mutt_parse_part(fp, last); 674 676 675 677 return (head); ··· 965 967 { 966 968 MESSAGE *msg; 967 969 968 - do { 970 + do 971 + { 969 972 if (cur->content->type != TYPEMESSAGE && 970 973 cur->content->type != TYPEMULTIPART) 971 974 break; /* nothing to do */ ··· 1250 1253 { 1251 1254 while (*p) 1252 1255 { 1253 - switch(*p) 1256 + switch (*p) 1254 1257 { 1255 1258 case 'r': 1256 1259 hdr->replied = 1;
+7 -7
pattern.c
··· 1130 1130 int a; 1131 1131 HEADER *h; 1132 1132 1133 - if(!t) 1133 + if (!t) 1134 1134 return 0; 1135 1135 h = t->message; 1136 - if(h) 1137 - if(mutt_pattern_exec(pat, flags, ctx, h, NULL)) 1136 + if (h) 1137 + if (mutt_pattern_exec(pat, flags, ctx, h, NULL)) 1138 1138 return 1; 1139 1139 1140 - if(up && (a=match_threadcomplete(pat, flags, ctx, t->parent,1,1,1,0))) 1140 + if (up && (a=match_threadcomplete(pat, flags, ctx, t->parent,1,1,1,0))) 1141 1141 return a; 1142 - if(right && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->next,0,0,1,1))) 1142 + if (right && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->next,0,0,1,1))) 1143 1143 return a; 1144 - if(left && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->prev,1,0,0,1))) 1144 + if (left && t->parent && (a=match_threadcomplete(pat, flags, ctx, t->prev,1,0,0,1))) 1145 1145 return a; 1146 - if(down && (a=match_threadcomplete(pat, flags, ctx, t->child,1,0,1,1))) 1146 + if (down && (a=match_threadcomplete(pat, flags, ctx, t->child,1,0,1,1))) 1147 1147 return a; 1148 1148 return 0; 1149 1149 }
+17 -17
pgp.c
··· 124 124 125 125 static pgp_key_t _pgp_parent(pgp_key_t k) 126 126 { 127 - if((k->flags & KEYFLAG_SUBKEY) && k->parent && option(OPTPGPIGNORESUB)) 127 + if ((k->flags & KEYFLAG_SUBKEY) && k->parent && option(OPTPGPIGNORESUB)) 128 128 k = k->parent; 129 129 130 130 return k; ··· 153 153 154 154 char *_pgp_keyid(pgp_key_t k) 155 155 { 156 - if(option(OPTPGPLONGIDS)) 156 + if (option(OPTPGPLONGIDS)) 157 157 return k->keyid; 158 158 else 159 159 return (k->keyid + 8); ··· 611 611 * Now, copy cleartext to the screen. 612 612 */ 613 613 614 - if(s->flags & MUTT_DISPLAY) 614 + if (s->flags & MUTT_DISPLAY) 615 615 { 616 616 if (needpass) 617 617 state_attach_puts (_("[-- BEGIN PGP MESSAGE --]\n\n"), s); ··· 804 804 805 805 snprintf (sigfile, sizeof (sigfile), "%s.asc", tempfile); 806 806 807 - if(!(fp = safe_fopen (sigfile, "w"))) 807 + if (!(fp = safe_fopen (sigfile, "w"))) 808 808 { 809 809 mutt_perror(sigfile); 810 810 return -1; ··· 815 815 safe_fclose (&fp); 816 816 817 817 mutt_mktemp (pgperrfile, sizeof (pgperrfile)); 818 - if(!(pgperr = safe_fopen(pgperrfile, "w+"))) 818 + if (!(pgperr = safe_fopen(pgperrfile, "w+"))) 819 819 { 820 820 mutt_perror(pgperrfile); 821 821 unlink(sigfile); ··· 824 824 825 825 crypt_current_time (s, "PGP"); 826 826 827 - if((thepid = pgp_invoke_verify (NULL, &pgpout, NULL, 827 + if ((thepid = pgp_invoke_verify (NULL, &pgpout, NULL, 828 828 -1, -1, fileno(pgperr), 829 829 tempfile, sigfile)) != -1) 830 830 { ··· 890 890 891 891 void pgp_extract_keys_from_attachment_list (FILE *fp, int tag, BODY *top) 892 892 { 893 - if(!fp) 893 + if (!fp) 894 894 { 895 895 mutt_error _("Internal error. Please submit a bug report."); 896 896 return; ··· 899 899 mutt_endwin (NULL); 900 900 set_option(OPTDONTHANDLEPGPKEYS); 901 901 902 - for(; top; top = top->next) 902 + for (; top; top = top->next) 903 903 { 904 - if(!tag || top->tagged) 904 + if (!tag || top->tagged) 905 905 pgp_extract_keys_from_attachment (fp, top); 906 906 907 - if(!tag) 907 + if (!tag) 908 908 break; 909 909 } 910 910 ··· 932 932 unlink (pgperrfile); 933 933 934 934 mutt_mktemp (pgptmpfile, sizeof (pgptmpfile)); 935 - if((pgptmp = safe_fopen (pgptmpfile, "w")) == NULL) 935 + if ((pgptmp = safe_fopen (pgptmpfile, "w")) == NULL) 936 936 { 937 937 mutt_perror (pgptmpfile); 938 938 safe_fclose (&pgperr); ··· 1278 1278 fputs (buffer, stdout); 1279 1279 } 1280 1280 1281 - if(mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) 1281 + if (mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) 1282 1282 empty=1; 1283 1283 1284 1284 safe_fclose (&pgperr); ··· 1483 1483 unlink (pgperrfile); 1484 1484 1485 1485 mutt_mktemp (pgpinfile, sizeof (pgpinfile)); 1486 - if((fptmp = safe_fopen(pgpinfile, "w")) == NULL) 1486 + if ((fptmp = safe_fopen(pgpinfile, "w")) == NULL) 1487 1487 { 1488 1488 mutt_perror(pgpinfile); 1489 1489 unlink(tempfile); ··· 1517 1517 } 1518 1518 safe_fclose (&pgpin); 1519 1519 1520 - if(mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) 1520 + if (mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) 1521 1521 empty=1; 1522 1522 1523 1523 unlink(pgpinfile); 1524 1524 1525 1525 fflush (fpout); 1526 1526 rewind (fpout); 1527 - if(!empty) 1527 + if (!empty) 1528 1528 empty = (fgetc (fpout) == EOF); 1529 1529 safe_fclose (&fpout); 1530 1530 ··· 1691 1691 fprintf (pgpin, "%s\n", PgpPass); 1692 1692 safe_fclose (&pgpin); 1693 1693 1694 - if(mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) 1694 + if (mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) 1695 1695 empty=1; 1696 1696 1697 1697 mutt_unlink (pgpinfile); ··· 1702 1702 rewind (pgpout); 1703 1703 rewind (pgperr); 1704 1704 1705 - if(!empty) 1705 + if (!empty) 1706 1706 empty = (fgetc (pgpout) == EOF); 1707 1707 safe_fclose (&pgpout); 1708 1708
+15 -8
pgpewrap.c
··· 13 13 #include <unistd.h> 14 14 #include <string.h> 15 15 16 - void print_usage(const char *progname) { 16 + void print_usage(const char *progname) 17 + { 17 18 fprintf(stderr, "Command line usage: %s [flags] -- prefix [recipients]\n", progname); 18 19 exit(1); 19 20 } 20 21 21 - int main(int argc, char **argv) { 22 + int main(int argc, char **argv) 23 + { 22 24 char **opts, **opt, *pfx; 23 25 int i; 24 26 25 - if (argc <= 1) { 27 + if (argc <= 1) 28 + { 26 29 print_usage(argv[0]); 27 30 } 28 31 29 32 opts = malloc((2 * argc + 1) * sizeof (* opts)); /* __MEM_CHECKED__ */ 30 - if(!opts) { 33 + if (!opts) 34 + { 31 35 perror(argv[0]); 32 36 exit(2); 33 37 } ··· 44 48 *opt++ = argv[1]; 45 49 pfx = NULL; 46 50 47 - for(i = 2; i < argc; ) { 48 - if(!strcmp(argv[i], "--")) { 51 + for (i = 2; i < argc; ) 52 + { 53 + if (!strcmp(argv[i], "--")) 54 + { 49 55 i += 2; 50 - if(i > argc) { 56 + if (i > argc) 57 + { 51 58 print_usage(argv[0]); 52 59 } 53 60 pfx = argv[i-1]; 54 61 } 55 - if(pfx) 62 + if (pfx) 56 63 *opt++ = pfx; 57 64 *opt++ = argv[i++]; 58 65 }
+2 -2
pgppubring.c
··· 932 932 print_userid (uid->addr); 933 933 printf ("::"); 934 934 935 - if(pgp_canencrypt(p->numalg)) 935 + if (pgp_canencrypt(p->numalg)) 936 936 putchar ('e'); 937 - if(pgp_cansign(p->numalg)) 937 + if (pgp_cansign(p->numalg)) 938 938 putchar ('s'); 939 939 if (p->flags & KEYFLAG_DISABLED) 940 940 putchar ('D');
+2 -1
pop_lib.c
··· 63 63 acct->flags |= MUTT_ACCT_SSL; 64 64 65 65 service = getservbyname (url.scheme == U_POP ? "pop3" : "pop3s", "tcp"); 66 - if (!acct->port) { 66 + if (!acct->port) 67 + { 67 68 if (service) 68 69 acct->port = ntohs (service->s_port); 69 70 else
+6 -6
postpone.c
··· 471 471 */ 472 472 case 'm': 473 473 case 'M': 474 - if(*(p+1) == '<') 474 + if (*(p+1) == '<') 475 475 { 476 476 for (p += 2; *p && *p != '>'; p++) 477 477 ; 478 - if(*p != '>') 478 + if (*p != '>') 479 479 { 480 480 mutt_error _("Illegal crypto header"); 481 481 return 0; ··· 489 489 case 'C': 490 490 q = smime_cryptalg; 491 491 492 - if(*(p+1) == '<') 492 + if (*(p+1) == '<') 493 493 { 494 - for(p += 2; *p && *p != '>' && q < smime_cryptalg + sizeof(smime_cryptalg) - 1; 495 - *q++ = *p++) 494 + for (p += 2; *p && *p != '>' && q < smime_cryptalg + sizeof(smime_cryptalg) - 1; 495 + *q++ = *p++) 496 496 ; 497 497 498 - if(*p != '>') 498 + if (*p != '>') 499 499 { 500 500 mutt_error _("Illegal S/MIME header"); 501 501 return 0;
+1 -1
query.c
··· 63 63 if (!(tmp = rfc822_cpy_adr (r->addr, 0))) 64 64 return NULL; 65 65 66 - if(!tmp->next && !tmp->personal) 66 + if (!tmp->next && !tmp->personal) 67 67 tmp->personal = safe_strdup (r->name); 68 68 69 69 mutt_addrlist_to_intl (tmp, NULL);
+24 -23
recvattach.c
··· 192 192 optional = 0; 193 193 break; 194 194 case 'd': 195 - if(!optional) 195 + if (!optional) 196 196 { 197 197 if (aptr->content->description) 198 198 { ··· 217 217 break; 218 218 } 219 219 } 220 - else if(aptr->content->description || 221 - (mutt_is_message_type (aptr->content->type, aptr->content->subtype) 222 - && MsgFmt && aptr->content->hdr)) 220 + else if (aptr->content->description || 221 + (mutt_is_message_type (aptr->content->type, aptr->content->subtype) 222 + && MsgFmt && aptr->content->hdr)) 223 223 break; 224 224 /* FALLS THROUGH TO 'F' */ 225 225 case 'F': ··· 238 238 } 239 239 /* FALLS THROUGH TO 'f' */ 240 240 case 'f': 241 - if(!optional) 241 + if (!optional) 242 242 { 243 243 if (aptr->content->filename && *aptr->content->filename == '/') 244 244 { ··· 251 251 else 252 252 mutt_format_s (dest, destlen, prefix, NONULL (aptr->content->filename)); 253 253 } 254 - else if(!aptr->content->filename) 254 + else if (!aptr->content->filename) 255 255 optional = 0; 256 256 break; 257 257 case 'D': 258 - if(!optional) 258 + if (!optional) 259 259 snprintf (dest, destlen, "%c", aptr->content->deleted ? 'D' : ' '); 260 - else if(!aptr->content->deleted) 260 + else if (!aptr->content->deleted) 261 261 optional = 0; 262 262 break; 263 263 case 'e': 264 - if(!optional) 264 + if (!optional) 265 265 mutt_format_s (dest, destlen, prefix, 266 266 ENCODING (aptr->content->encoding)); 267 267 break; ··· 282 282 } 283 283 break; 284 284 case 'm': 285 - if(!optional) 285 + if (!optional) 286 286 mutt_format_s (dest, destlen, prefix, TYPE (aptr->content)); 287 287 break; 288 288 case 'M': 289 - if(!optional) 289 + if (!optional) 290 290 mutt_format_s (dest, destlen, prefix, aptr->content->subtype); 291 - else if(!aptr->content->subtype) 291 + else if (!aptr->content->subtype) 292 292 optional = 0; 293 293 break; 294 294 case 'n': 295 - if(!optional) 295 + if (!optional) 296 296 { 297 297 snprintf (fmt, sizeof (fmt), "%%%sd", prefix); 298 298 snprintf (dest, destlen, fmt, aptr->num + 1); ··· 317 317 else 318 318 l = aptr->content->length; 319 319 320 - if(!optional) 320 + if (!optional) 321 321 { 322 322 mutt_pretty_size (tmp, sizeof(tmp), l); 323 323 mutt_format_s (dest, destlen, prefix, tmp); ··· 327 327 328 328 break; 329 329 case 't': 330 - if(!optional) 330 + if (!optional) 331 331 snprintf (dest, destlen, "%c", aptr->content->tagged ? '*' : ' '); 332 - else if(!aptr->content->tagged) 332 + else if (!aptr->content->tagged) 333 333 optional = 0; 334 334 break; 335 335 case 'T': 336 - if(!optional) 336 + if (!optional) 337 337 mutt_format_s_tree (dest, destlen, prefix, NONULL (aptr->tree)); 338 338 else if (!aptr->tree) 339 339 optional = 0; 340 340 break; 341 341 case 'u': 342 - if(!optional) 342 + if (!optional) 343 343 snprintf (dest, destlen, "%c", aptr->content->unlink ? '-' : ' '); 344 344 else if (!aptr->content->unlink) 345 345 optional = 0; ··· 424 424 else 425 425 strfcpy (buf, body->filename, sizeof (buf)); 426 426 } 427 - else if(body->hdr && 428 - body->encoding != ENCBASE64 && 429 - body->encoding != ENCQUOTEDPRINTABLE && 430 - mutt_is_message_type(body->type, body->subtype)) 427 + else if (body->hdr && 428 + body->encoding != ENCBASE64 && 429 + body->encoding != ENCQUOTEDPRINTABLE && 430 + mutt_is_message_type(body->type, body->subtype)) 431 431 mutt_default_save(buf, sizeof(buf), body->hdr); 432 432 else 433 433 buf[0] = 0; ··· 589 589 snprintf (warning, sizeof (warning), 590 590 _("WARNING! You are about to overwrite %s, continue?"), 591 591 body->filename); 592 - if (mutt_yesorno (warning, MUTT_NO) != MUTT_YES) { 592 + if (mutt_yesorno (warning, MUTT_NO) != MUTT_YES) 593 + { 593 594 mutt_window_clearline (MuttMessageWindow, 0); 594 595 return; 595 596 }
+13 -13
rfc1524.c
··· 452 452 453 453 static void strnfcpy(char *d, const char *s, size_t siz, size_t len) 454 454 { 455 - if(len > siz) 455 + if (len > siz) 456 456 len = siz - 1; 457 457 strfcpy(d, s, len); 458 458 } ··· 509 509 */ 510 510 511 511 lmatch = 1; ps = 0; 512 - for(i = 0; nametemplate[i]; i++) 512 + for (i = 0; nametemplate[i]; i++) 513 513 { 514 - if(nametemplate[i] == '%' && nametemplate[i+1] == 's') 514 + if (nametemplate[i] == '%' && nametemplate[i+1] == 's') 515 515 { 516 516 ps = 1; 517 517 break; ··· 519 519 520 520 /* note that the following will _not_ read beyond oldfile's end. */ 521 521 522 - if(lmatch && nametemplate[i] != oldfile[i]) 522 + if (lmatch && nametemplate[i] != oldfile[i]) 523 523 lmatch = 0; 524 524 } 525 525 526 - if(ps) 526 + if (ps) 527 527 { 528 528 529 529 /* If we had a "%s", check the rest. */ ··· 543 543 544 544 rmatch = 1; 545 545 546 - for(j = mutt_strlen(oldfile) - 1, k = mutt_strlen(nametemplate) - 1 ; 547 - j >= (lmatch ? i : 0) && k >= i + 2; 548 - j--, k--) 546 + for (j = mutt_strlen(oldfile) - 1, k = mutt_strlen(nametemplate) - 1 ; 547 + j >= (lmatch ? i : 0) && k >= i + 2; 548 + j--, k--) 549 549 { 550 - if(nametemplate[k] != oldfile[j]) 550 + if (nametemplate[k] != oldfile[j]) 551 551 { 552 552 rmatch = 0; 553 553 break; ··· 556 556 557 557 /* Now, check if we had a full match. */ 558 558 559 - if(k >= i + 2) 559 + if (k >= i + 2) 560 560 rmatch = 0; 561 561 562 - if(lmatch) *left = 0; 562 + if (lmatch) *left = 0; 563 563 else strnfcpy(left, nametemplate, sizeof(left), i); 564 564 565 - if(rmatch) *right = 0; 565 + if (rmatch) *right = 0; 566 566 else strfcpy(right, nametemplate + i + 2, sizeof(right)); 567 567 568 568 snprintf(newfile, nflen, "%s%s%s", left, oldfile, right); ··· 576 576 577 577 mutt_adv_mktemp(newfile, nflen); 578 578 579 - if(rmatch && lmatch) 579 + if (rmatch && lmatch) 580 580 return 0; 581 581 else 582 582 return 1;
+2 -1
rfc3676.c
··· 363 363 364 364 while (fgets (buf, sizeof (buf), in)) 365 365 { 366 - if (ascii_strncmp ("From ", buf, 5) == 0 || buf[0] == ' ') { 366 + if (ascii_strncmp ("From ", buf, 5) == 0 || buf[0] == ' ') 367 + { 367 368 fputc (' ', out); 368 369 #if DEBUG 369 370 lc++;
+2 -1
score.c
··· 105 105 Score = ptr; 106 106 ptr->pat = pat; 107 107 ptr->str = pattern; 108 - } else 108 + } 109 + else 109 110 /* 'buf' arg was cleared and 'pattern' holds the only reference; 110 111 * as here 'ptr' != NULL -> update the value only in which case 111 112 * ptr->str already has the string, so pattern should be freed.
+6 -5
send.c
··· 303 303 { 304 304 FREE(&env->message_id); 305 305 env->message_id = tmp; 306 - } else 306 + } 307 + else 307 308 FREE(&tmp); 308 309 } 309 310 else if (ascii_strncasecmp ("to:", uh->data, 3) != 0 && ··· 558 559 559 560 if ((flags & SENDGROUPREPLY) && (!in->mail_followup_to || hmfupto != MUTT_YES)) 560 561 { 561 - /* if(!mutt_addr_is_user(in->to)) */ 562 + /* if (!mutt_addr_is_user(in->to)) */ 562 563 rfc822_append (&out->cc, in->to, 1); 563 564 rfc822_append (&out->cc, in->cc, 1); 564 565 } ··· 672 673 LIST **p = NULL, **q = NULL; 673 674 int i; 674 675 675 - for(i = 0; i < ctx->vcount; i++) 676 + for (i = 0; i < ctx->vcount; i++) 676 677 { 677 678 h = ctx->hdrs[ctx->v2r[i]]; 678 679 if (h->tagged) ··· 1098 1099 { 1099 1100 if (clear_content->type == TYPEMULTIPART) 1100 1101 { 1101 - if(!(msg->security & ENCRYPT) && (msg->security & SIGN)) 1102 + if (!(msg->security & ENCRYPT) && (msg->security & SIGN)) 1102 1103 { 1103 1104 /* save initial signature and attachments */ 1104 1105 save_sig = msg->content->parts->next; ··· 1450 1451 if ((i = query_quadoption (OPT_RECALL, _("Recall postponed message?"))) == -1) 1451 1452 return rv; 1452 1453 1453 - if(i == MUTT_YES) 1454 + if (i == MUTT_YES) 1454 1455 flags |= SENDPOSTPONED; 1455 1456 } 1456 1457
+20 -19
sendlib.c
··· 217 217 { 218 218 short i; 219 219 220 - if(!b64_num) 220 + if (!b64_num) 221 221 return; 222 222 223 - if(b64_linelen >= 72) 223 + if (b64_linelen >= 72) 224 224 { 225 225 fputc('\n', fout); 226 226 b64_linelen = 0; 227 227 } 228 228 229 - for(i = b64_num; i < 3; i++) 229 + for (i = b64_num; i < 3; i++) 230 230 b64_buffer[i] = '\0'; 231 231 232 232 fputc(B64Chars[(b64_buffer[0] >> 2) & 0x3f], fout); ··· 234 234 fputc(B64Chars[((b64_buffer[0] & 0x3) << 4) | ((b64_buffer[1] >> 4) & 0xf) ], fout); 235 235 b64_linelen++; 236 236 237 - if(b64_num > 1) 237 + if (b64_num > 1) 238 238 { 239 239 fputc(B64Chars[((b64_buffer[1] & 0xf) << 2) | ((b64_buffer[2] >> 6) & 0x3) ], fout); 240 240 b64_linelen++; 241 - if(b64_num > 2) 241 + if (b64_num > 2) 242 242 { 243 243 fputc(B64Chars[b64_buffer[2] & 0x3f], fout); 244 244 b64_linelen++; 245 245 } 246 246 } 247 247 248 - while(b64_linelen % 4) 248 + while (b64_linelen % 4) 249 249 { 250 250 fputc('=', fout); 251 251 b64_linelen++; ··· 257 257 258 258 static void b64_putc(char c, FILE *fout) 259 259 { 260 - if(b64_num == 3) 260 + if (b64_num == 3) 261 261 b64_flush(fout); 262 262 263 263 b64_buffer[b64_num++] = c; ··· 306 306 { 307 307 len = 25 + mutt_strlen (a->subtype); /* approximate len. of content-type */ 308 308 309 - for(p = a->parameter; p; p = p->next) 309 + for (p = a->parameter; p; p = p->next) 310 310 { 311 311 char *tmp; 312 312 313 - if(!p->value) 313 + if (!p->value) 314 314 continue; 315 315 316 316 fputc (';', f); ··· 873 873 874 874 struct stat sb; 875 875 876 - if(b && !fname) fname = b->filename; 876 + if (b && !fname) fname = b->filename; 877 877 878 878 if (stat (fname, &sb) == -1) 879 879 { ··· 1107 1107 unlink (a->filename); 1108 1108 a->filename = safe_strdup (temp); 1109 1109 a->unlink = 1; 1110 - if(stat (a->filename, &sb) == -1) 1110 + if (stat (a->filename, &sb) == -1) 1111 1111 { 1112 1112 mutt_perror ("stat"); 1113 1113 return; ··· 1165 1165 mutt_update_encoding (a); 1166 1166 if (a->encoding == ENC8BIT) 1167 1167 a->encoding = ENCQUOTEDPRINTABLE; 1168 - else if(a->encoding == ENCBINARY) 1168 + else if (a->encoding == ENCBINARY) 1169 1169 a->encoding = ENCBASE64; 1170 1170 } 1171 1171 } ··· 1272 1272 if (WithCrypto) 1273 1273 { 1274 1274 if ((option(OPTMIMEFORWDECODE) || option(OPTFORWDECRYPT)) && 1275 - (hdr->security & ENCRYPT)) { 1275 + (hdr->security & ENCRYPT)) 1276 + { 1276 1277 if (!crypt_valid_passphrase(hdr->security)) 1277 1278 return (NULL); 1278 1279 } ··· 2147 2148 { 2148 2149 char *p = NULL; 2149 2150 2150 - if(Fqdn && Fqdn[0] != '@') 2151 + if (Fqdn && Fqdn[0] != '@') 2151 2152 { 2152 2153 p = Fqdn; 2153 2154 2154 - if(may_hide_host && option(OPTHIDDENHOST)) 2155 + if (may_hide_host && option(OPTHIDDENHOST)) 2155 2156 { 2156 - if((p = strchr(Fqdn, '.'))) 2157 + if ((p = strchr(Fqdn, '.'))) 2157 2158 p++; 2158 2159 2159 2160 /* sanity check: don't hide the host if 2160 2161 * the fqdn is something like detebe.org. 2161 2162 */ 2162 2163 2163 - if(!p || !strchr(p, '.')) 2164 + if (!p || !strchr(p, '.')) 2164 2165 p = Fqdn; 2165 2166 } 2166 2167 } ··· 2177 2178 2178 2179 now = time (NULL); 2179 2180 tm = gmtime (&now); 2180 - if(!(fqdn = mutt_fqdn(0))) 2181 + if (!(fqdn = mutt_fqdn(0))) 2181 2182 fqdn = NONULL(Hostname); 2182 2183 2183 2184 snprintf (buf, sizeof (buf), "<%d%02d%02d%02d%02d%02d.G%c%u@%s>", ··· 2731 2732 2732 2733 static void set_noconv_flags (BODY *b, short flag) 2733 2734 { 2734 - for(; b; b = b->next) 2735 + for (; b; b = b->next) 2735 2736 { 2736 2737 if (b->type == TYPEMESSAGE || b->type == TYPEMULTIPART) 2737 2738 set_noconv_flags (b->parts, flag);
+15 -10
smime.c
··· 201 201 202 202 case 'c': 203 203 { /* certificate (list) */ 204 - if (!optional) { 204 + if (!optional) 205 + { 205 206 snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 206 207 snprintf (dest, destlen, fmt, NONULL(cctx->certificates)); 207 208 } ··· 212 213 213 214 case 'i': 214 215 { /* intermediate certificates */ 215 - if (!optional) { 216 + if (!optional) 217 + { 216 218 snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 217 219 snprintf (dest, destlen, fmt, NONULL(cctx->intermediates)); 218 220 } ··· 247 249 248 250 case 'a': 249 251 { /* algorithm for encryption */ 250 - if (!optional) { 252 + if (!optional) 253 + { 251 254 snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 252 255 snprintf (dest, destlen, fmt, NONULL (cctx->cryptalg)); 253 256 } ··· 270 273 271 274 case 'd': 272 275 { /* algorithm for the signature message digest */ 273 - if (!optional) { 276 + if (!optional) 277 + { 274 278 snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 275 279 snprintf (dest, destlen, fmt, NONULL (cctx->digestalg)); 276 280 } ··· 375 379 smime_key_t **Table = (smime_key_t **) menu->data; 376 380 smime_key_t *this = Table[num]; 377 381 char* truststate; 378 - switch(this->trust) { 382 + switch (this->trust) 383 + { 379 384 case 't': 380 385 truststate = N_("Trusted "); 381 386 break; ··· 979 984 len = mutt_strlen (email); 980 985 if (len && (email[len - 1] == '\n')) 981 986 email[len - 1] = '\0'; 982 - if(mutt_strncasecmp (email, mailbox, mutt_strlen (mailbox)) == 0) 987 + if (mutt_strncasecmp (email, mailbox, mutt_strlen (mailbox)) == 0) 983 988 ret=1; 984 989 985 990 ret = ret < 0 ? 0 : ret; ··· 997 1002 ret = 1; 998 1003 else ret = 0; 999 1004 1000 - if(copy && buffer && num) 1005 + if (copy && buffer && num) 1001 1006 { 1002 1007 (*num) = count; 1003 1008 *buffer = safe_calloc(sizeof(char*), count); ··· 1014 1019 count++; 1015 1020 } 1016 1021 } 1017 - else if(copy) ret = 2; 1022 + else if (copy) ret = 2; 1018 1023 1019 1024 safe_fclose (&fpout); 1020 1025 safe_fclose (&fperr); ··· 1282 1287 return 1; 1283 1288 } 1284 1289 1285 - if(h->security & ENCRYPT) 1290 + if (h->security & ENCRYPT) 1286 1291 mutt_copy_message (fpout, Context, h, 1287 1292 MUTT_CM_DECODE_CRYPT & MUTT_CM_DECODE_SMIME, 1288 1293 CH_MIME|CH_WEED|CH_NONEWLINE); ··· 1310 1315 mutt_unlink(tempfname); 1311 1316 if (smime_handle_cert_email (certfile, mbox, 0, NULL, NULL)) 1312 1317 { 1313 - if(isendwin()) 1318 + if (isendwin()) 1314 1319 mutt_any_key_to_continue(NULL); 1315 1320 } 1316 1321 else
+8 -5
smtp.c
··· 105 105 int n; 106 106 char buf[1024]; 107 107 108 - do { 108 + do 109 + { 109 110 n = mutt_socket_readln (buf, sizeof (buf), conn); 110 - if (n < 4) { 111 + if (n < 4) 112 + { 111 113 /* read error, or no response code */ 112 114 return smtp_err_read; 113 115 } ··· 266 268 { 267 269 while (a) 268 270 { 269 - if(a->mailbox && !a->group && address_uses_unicode(a->mailbox)) 271 + if (a->mailbox && !a->group && address_uses_unicode(a->mailbox)) 270 272 return 1; 271 273 a = a->next; 272 274 } ··· 430 432 #endif 431 433 } 432 434 433 - if(!(fqdn = mutt_fqdn (0))) 435 + if (!(fqdn = mutt_fqdn (0))) 434 436 fqdn = NONULL (Hostname); 435 437 436 438 snprintf (buf, sizeof (buf), "%s %s\r\n", Esmtp ? "EHLO" : "HELO", fqdn); ··· 624 626 } 625 627 safe_strcat (buf, bufsize, "\r\n"); 626 628 627 - do { 629 + do 630 + { 628 631 if (mutt_socket_write (conn, buf) < 0) 629 632 goto fail; 630 633 if ((rc = mutt_socket_readln (buf, bufsize, conn)) < 0)
+15 -10
snprintf.c
··· 152 152 if (ch == '\0') 153 153 state = DP_S_DONE; 154 154 155 - switch(state) 155 + switch (state) 156 156 { 157 157 case DP_S_DEFAULT: 158 158 if (ch == '%') ··· 456 456 457 457 uvalue = value; 458 458 459 - if(!(flags & DP_F_UNSIGNED)) 459 + if (!(flags & DP_F_UNSIGNED)) 460 460 { 461 - if( value < 0 ) { 461 + if ( value < 0 ) 462 + { 462 463 signvalue = '-'; 463 464 uvalue = -value; 464 465 } ··· 472 473 473 474 if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ 474 475 475 - do { 476 + do 477 + { 476 478 convert[place++] = 477 479 (caps? "0123456789ABCDEF":"0123456789abcdef") 478 480 [uvalue % (unsigned)base ]; 479 481 uvalue = (uvalue / (unsigned)base ); 480 - } while(uvalue && (place < 20)); 482 + } while (uvalue && (place < 20)); 481 483 if (place == 20) place--; 482 484 convert[place] = 0; 483 485 ··· 524 526 dopr_outch (buffer, currlen, maxlen, convert[--place]); 525 527 526 528 /* Left Justified spaces */ 527 - while (spadlen < 0) { 529 + while (spadlen < 0) 530 + { 528 531 dopr_outch (buffer, currlen, maxlen, ' '); 529 532 ++spadlen; 530 533 } ··· 627 630 #endif 628 631 629 632 /* Convert integer part */ 630 - do { 633 + do 634 + { 631 635 iconvert[iplace++] = 632 636 (caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10]; 633 637 intpart = (intpart / 10); 634 - } while(intpart && (iplace < 20)); 638 + } while (intpart && (iplace < 20)); 635 639 if (iplace == 20) iplace--; 636 640 iconvert[iplace] = 0; 637 641 638 642 /* Convert fractional part */ 639 - do { 643 + do 644 + { 640 645 fconvert[fplace++] = 641 646 (caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10]; 642 647 fracpart = (fracpart / 10); 643 - } while(fracpart && (fplace < 20)); 648 + } while (fracpart && (fplace < 20)); 644 649 if (fplace == 20) fplace--; 645 650 fconvert[fplace] = 0; 646 651
+2 -1
url.c
··· 67 67 } 68 68 else 69 69 return -1; 70 - } else 70 + } 71 + else 71 72 *d++ = *s; 72 73 } 73 74 *d ='\0';
+2 -1
wcwidth.c
··· 135 135 return 1; 136 136 137 137 /* binary search in table of non-spacing characters */ 138 - while (max >= min) { 138 + while (max >= min) 139 + { 139 140 mid = (min + max) / 2; 140 141 if (combining[mid].last < ucs) 141 142 min = mid + 1;