X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=handler.c;h=b5c3bda6b35c2d49a3accf9684c71eadf115075b;hp=8ddee8c76cb28d90a3bb6744ecb39ba812772000;hb=9c02039bb94c2fb846e0226c321c7dd79df455c4;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/handler.c b/handler.c index 8ddee8c..b5c3bda 100644 --- a/handler.c +++ b/handler.c @@ -1,19 +1,10 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996-2000 Michael R. Elkins - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ #if HAVE_CONFIG_H @@ -37,6 +28,9 @@ #include "mutt_crypt.h" #include "lib.h" +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" #define BUFI_SIZE 1000 #define BUFO_SIZE 2000 @@ -247,7 +241,7 @@ void mutt_decode_quoted (STATE * s, long len, int istext, iconv_t cd) if (fgets (line, MIN ((ssize_t) sizeof (line), len + 1), s->fpin) == NULL) break; - linelen = strlen (line); + linelen = mutt_strlen (line); len -= linelen; /* @@ -949,7 +943,7 @@ static void text_plain_flowed_handler (BODY * a, STATE * s) fprintf (stderr, "flowed_max = %d\n", flowed_max); while (bytes > 0 && fgets (line, sizeof (line), s->fpin)) { - bytes -= strlen (line); + bytes -= mutt_strlen (line); tail = NULL; last_full = full; @@ -979,7 +973,7 @@ static void text_plain_flowed_handler (BODY * a, STATE * s) */ full = 0; - l = strlen (t + 1); + l = mutt_strlen (t + 1); t[0] = ' '; t[1] = '\0'; @@ -1132,7 +1126,7 @@ static void print_flowed_line (char *line, STATE * s, int ql) { int width; char *pos, *oldpos; - int len = strlen (line); + int len = mutt_strlen (line); int i; if (MaxLineLength > 0) { @@ -1156,7 +1150,7 @@ static void print_flowed_line (char *line, STATE * s, int ql) /* fprintf(stderr,"print_flowed_line will print `%s' with ql = %d\n",line,ql); */ - if (strlen (line) == 0) { + if (mutt_strlen (line) == 0) { if (option (OPTQUOTEEMPTY)) { if (s->prefix) state_puts(s->prefix,s); @@ -1239,24 +1233,24 @@ static void text_plain_flowed_handler (BODY * a, STATE * s) while (bytes > 0 && fgets (buf, sizeof (buf), s->fpin)) { /* fprintf(stderr,"read `%s'",buf); */ - bytes -= strlen (buf); + bytes -= mutt_strlen (buf); newql = get_quote_level (buf); if ((t = strrchr (buf, '\n')) || (t = strrchr (buf, '\r'))) { *t = '\0'; - if (strlen (curline) > 0 && curline[strlen (curline) - 1] == ' ' + if (mutt_strlen (curline) > 0 && curline[mutt_strlen (curline) - 1] == ' ' && newql == quotelevel && strcmp (curline + quotelevel, "-- ") != 0) { if (buf[newql] == ' ') - curline[strlen (curline) - 1] = '\0'; + curline[mutt_strlen (curline) - 1] = '\0'; - curline = realloc (curline, curline_len + strlen (buf)); + curline = realloc (curline, curline_len + mutt_strlen (buf)); if (curline_len == 1) *curline = '\0'; - curline_len += strlen (buf); + curline_len += mutt_strlen (buf); safe_strncat (curline, curline_len, buf + newql, - strlen (buf + newql)); + mutt_strlen (buf + newql)); } else { if (first_line) { @@ -1267,11 +1261,11 @@ static void text_plain_flowed_handler (BODY * a, STATE * s) } FREE (&curline); curline_len = 1; - curline = realloc (curline, curline_len + strlen (buf)); + curline = realloc (curline, curline_len + mutt_strlen (buf)); if (curline_len == 1) *curline = '\0'; - curline_len += strlen (buf); - safe_strncat (curline, curline_len, buf, strlen (buf)); + curline_len += mutt_strlen (buf); + safe_strncat (curline, curline_len, buf, mutt_strlen (buf)); quotelevel = newql; } }