From 4f91d5d6e8ab40320421406d735eb72c8ff9575e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 17 Sep 2018 18:19:23 -0400 Subject: [PATCH] html_to_ascii() , removed unused option do_citaformat --- citadel/citadel.h | 2 +- citadel/msgbase.c | 2 +- libcitadel/lib/html_to_ascii.c | 18 ++---------------- libcitadel/lib/libcitadel.h | 4 ++-- libcitadel/tests/stringbuf_conversion.c | 2 +- textclient/messages.c | 2 +- webcit/messages.c | 2 +- webcit/webcit.h | 2 +- 8 files changed, 10 insertions(+), 24 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index 3a4ddf246..b7fbae097 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -38,7 +38,7 @@ extern "C" { #define REV_LEVEL 922 // This version #define REV_MIN 591 // Oldest compatible database #define EXPORT_REV_MIN 760 // Oldest compatible export files -#define LIBCITADEL_MIN 920 // Minimum required version of libcitadel +#define LIBCITADEL_MIN 921 // Minimum required version of libcitadel #define SERVER_TYPE 0 // zero for stock Citadel; other developers please // obtain SERVER_TYPE codes for your implementations diff --git a/citadel/msgbase.c b/citadel/msgbase.c index a88a76369..7f6b7c9da 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1308,7 +1308,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp, } if (!strcasecmp(cbtype, "text/html")) { - ptr = html_to_ascii(content, length, 80, 0); + ptr = html_to_ascii(content, length, 80); wlen = strlen(ptr); client_write(ptr, wlen); if ((wlen > 0) && (ptr[wlen-1] != '\n')) { diff --git a/libcitadel/lib/html_to_ascii.c b/libcitadel/lib/html_to_ascii.c index 29d0e31c4..9298dd6c7 100644 --- a/libcitadel/lib/html_to_ascii.c +++ b/libcitadel/lib/html_to_ascii.c @@ -1,6 +1,6 @@ /* * Functions which handle translation between HTML and plain text - * Copyright (c) 2000-2010 by the citadel.org team + * Copyright (c) 2000-2018 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,9 +47,8 @@ * * inputmsg = pointer to raw HTML message * screenwidth = desired output screenwidth - * do_citaformat = set to 1 to indent newlines with spaces */ -char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_citaformat) { +char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth) { char inbuf[SIZ]; int inbuf_len = 0; char outbuf[SIZ]; @@ -543,11 +542,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci strncpy(&outptr[output_len], outbuf, i+1); output_len += (i+1); - if (do_citaformat) { - strcpy(&outptr[output_len], " "); - ++output_len; - } - strcpy(outbuf, &outbuf[i+1]); i = 0; did_out = 1; @@ -567,10 +561,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci output_len += rb; strcpy(&outptr[output_len], nl); output_len += strlen(nl); - if (do_citaformat) { - strcpy(&outptr[output_len], " "); - ++output_len; - } strcpy(outbuf, &outbuf[rb+1]); } else { strncpy(&outptr[output_len], outbuf, @@ -578,10 +568,6 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci output_len += (screenwidth-2); strcpy(&outptr[output_len], nl); output_len += strlen(nl); - if (do_citaformat) { - strcpy(&outptr[output_len], " "); - ++output_len; - } strcpy(outbuf, &outbuf[screenwidth-2]); } } diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index f22e77f10..3dbea9588 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -28,7 +28,7 @@ #include #include -#define LIBCITADEL_VERSION_NUMBER 920 +#define LIBCITADEL_VERSION_NUMBER 921 /* * Here's a bunch of stupid magic to make the MIME parser portable. @@ -463,7 +463,7 @@ char *rfc2047encode(const char *line, long length); int is_msg_in_mset(const char *mset, long msgnum); int pattern2(char *search, char *patn); void stripltlen(char *, int *); -char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_citaformat); +char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth); void LoadEntityList(char *FileName); diff --git a/libcitadel/tests/stringbuf_conversion.c b/libcitadel/tests/stringbuf_conversion.c index 00cbbe426..8305f4677 100644 --- a/libcitadel/tests/stringbuf_conversion.c +++ b/libcitadel/tests/stringbuf_conversion.c @@ -362,7 +362,7 @@ static void TestHTML2ASCII_line(void) StrBufTCP_read_line(Source, &fdin, 0, &Err); printf("the source:>%s<\n", ChrPtr(Source)); - Target = html_to_ascii(ChrPtr(Source), StrLength(Source), 80, 0); + Target = html_to_ascii(ChrPtr(Source), StrLength(Source), 80); printf("the target:>%s<\n", Target); FlushStrBuf(Source); diff --git a/textclient/messages.c b/textclient/messages.c index a6d520172..b647229e1 100644 --- a/textclient/messages.c +++ b/textclient/messages.c @@ -596,7 +596,7 @@ int read_message(CtdlIPC * ipc, long num, /* message number */ * of the client screen. */ if (!strcasecmp(message->content_type, "text/html")) { - converted_text = html_to_ascii(message->text, 0, screenwidth, 0); + converted_text = html_to_ascii(message->text, 0, screenwidth); if (converted_text != NULL) { free(message->text); message->text = converted_text; diff --git a/webcit/messages.c b/webcit/messages.c index 7307d5eb6..d1b0f2081 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -923,7 +923,7 @@ void post_mime_to_server(void) { serv_puts("Content-type: text/plain; charset=utf-8"); serv_puts("Content-Transfer-Encoding: quoted-printable"); serv_puts(""); - txtmail = html_to_ascii(bstr("msgtext"), 0, 80, 0); + txtmail = html_to_ascii(bstr("msgtext"), 0, 80); Buf = NewStrBufPlain(txtmail, -1); free(txtmail); diff --git a/webcit/webcit.h b/webcit/webcit.h index 030b75a53..e6e10d07e 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -129,7 +129,7 @@ extern char *ssl_cipher_list; #define CLIENT_ID 4 #define CLIENT_VERSION 921 /* This version of WebCit */ #define MINIMUM_CIT_VERSION 920 /* Minimum required version of Citadel server */ -#define LIBCITADEL_MIN 920 /* Minimum required version of libcitadel */ +#define LIBCITADEL_MIN 921 /* Minimum required version of libcitadel */ #define DEFAULT_HOST "localhost" /* Default Citadel server */ #define DEFAULT_PORT "504" #define TARGET "webcit01" /* Window target for inline URL's */ -- 2.30.2