On 2026-07-12T13:18:47+0800, Kevin J. McCarthy wrote: > I thought I had left more functions in lib.c after the conversion to > BUFFERs, but I could only find these three functions that aren't used > anymore: mutt_concat_path(), mutt_dup_header(), and > mutt_display_sanitize().
Nice!
Cheers,
Alex
> ---
> lib.c | 13 -------------
> lib.h | 1 -
> muttlib.c | 18 ------------------
> protos.h | 2 --
> 4 files changed, 34 deletions(-)
>
> diff --git a/lib.c b/lib.c
> index 649fdb3a..9776fcdb 100644
> --- a/lib.c
> +++ b/lib.c
> @@ -756,19 +756,6 @@ void mutt_remove_trailing_ascii_ws(char *s)
> *p = 0;
> }
>
> -char *mutt_concat_path(char *d, const char *dir, const char *fname, size_t l)
> -{
> - const char *fmt = "%s/%s";
> -
> - if (!*fname || (*dir && dir[strlen(dir)-1] == '/'))
> - fmt = "%s%s";
> -
> - fname += strspn(fname, "/");
> -
> - snprintf(d, l, fmt, dir, fname);
> - return d;
> -}
> -
> const char *mutt_basename(const char *f)
> {
> const char *p = strrchr(f, '/');
> diff --git a/lib.h b/lib.h
> index 72e3a498..25875656 100644
> --- a/lib.h
> +++ b/lib.h
> @@ -203,7 +203,6 @@ void mutt_debug_f(const char *, const int, const char *,
> const int err, const ch
>
> /* The actual library functions. */
>
> -char *mutt_concat_path(char *, const char *, const char *, size_t);
> char *mutt_read_line(char *, size_t *, FILE *, int *, int);
> char *mutt_skip_ascii_ws(char *);
> char *mutt_strlower(char *);
> diff --git a/muttlib.c b/muttlib.c
> index df882002..d24a37f0 100644
> --- a/muttlib.c
> +++ b/muttlib.c
> @@ -382,15 +382,6 @@ LIST *mutt_copy_list(LIST *p)
> return (l);
> }
>
> -HEADER *mutt_dup_header(HEADER *h)
> -{
> - HEADER *hnew;
> -
> - hnew = mutt_new_header();
> - memcpy(hnew, h, sizeof(HEADER));
> - return hnew;
> -}
> -
> void mutt_free_header(HEADER **h)
> {
> if (!h || !*h) return;
> @@ -2150,15 +2141,6 @@ int state_putws(const wchar_t *ws, STATE *s)
> return 0;
> }
>
> -void mutt_display_sanitize(char *s)
> -{
> - for (; *s; s++)
> - {
> - if (!IsPrint(*s))
> - *s = '?';
> - }
> -}
> -
> void mutt_sleep(short s)
> {
> if (SleepTime > s)
> diff --git a/protos.h b/protos.h
> index 4958aa0e..7ea95ae5 100644
> --- a/protos.h
> +++ b/protos.h
> @@ -110,7 +110,6 @@ HASH *mutt_make_subj_hash(CONTEXT *);
>
> char *mutt_read_rfc822_line(FILE *, char *, size_t *);
> ENVELOPE *mutt_read_rfc822_header(FILE *, HEADER *, short, short);
> -HEADER *mutt_dup_header(HEADER *);
>
> int mutt_check_month(const char *);
> const char *mutt_ctime(const time_t *t);
> @@ -211,7 +210,6 @@ void mutt_decode_attachment(const BODY *, STATE *);
> void mutt_decode_base64(STATE *s, LOFF_T len, int istext, iconv_t cd);
> void mutt_default_save(char *, size_t, HEADER *);
> void mutt_display_address(ENVELOPE *);
> -void mutt_display_sanitize(char *);
> int mutt_edit_content_type(HEADER *, BODY *, FILE *);
> void mutt_edit_file(const char *, const char *);
> int mutt_edit_headers(const char *, SEND_CONTEXT *, int);
> --
> 2.55.0
>
--
<https://www.alejandro-colomar.es>
signature.asc
Description: PGP signature
