From 398178c265ff68ceeafa6a84089bc01ae949e314 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 12 May 2016 21:50:48 -0600 Subject: [PATCH] * When a filename is attached and its name is encoded, the save attachment command will offer to save the file in the encoded form. This might work for some users, but the save command will have a subcommand ^N to decode the file name and save the file with the decoded name. --- alpine/mailcmd.c | 19 ++++++++++++++++--- pith/pine.hlp | 6 ++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c index 4d51989..5e95d33 100644 --- a/alpine/mailcmd.c +++ b/alpine/mailcmd.c @@ -4233,9 +4233,6 @@ get_export_filename(struct pine *ps, char *filename, char *deefault, pos = hist_len + items_in_hist(dir_hist); - if(dir_hist == NULL) - init_hist(&dir_hist, HISTSIZE); - if(flags & GE_ALLPARTS || history || dir_hist){ /* * Copy the opts and add one to the end of the list. @@ -4282,6 +4279,15 @@ get_export_filename(struct pine *ps, char *filename, char *deefault, opts[i++].label = N_("Binary"); } + rfc1522_decode_to_utf8((unsigned char *)tmp_20k_buf, + SIZEOF_20KBUF, filename); + if(strcmp(tmp_20k_buf, filename)){ + opts[i].ch = ctrl('N'); + opts[i].rval = 40; + opts[i].name = "^N"; + opts[i++].label = "Name UTF8"; + } + if(dir_hist || hist_len > 0){ opts[i].ch = ctrl('Y'); opts[i].rval = 32; @@ -4827,6 +4833,13 @@ get_export_filename(struct pine *ps, char *filename, char *deefault, Writechar(BELL, 0); continue; } + else if(r == 40){ + rfc1522_decode_to_utf8((unsigned char *)tmp_20k_buf, + SIZEOF_20KBUF, filename); + strncpy(filename, tmp_20k_buf, len); + filename[len-1] = '\0'; + continue; + } else if(r != 0){ Writechar(BELL, 0); continue; diff --git a/pith/pine.hlp b/pith/pine.hlp index af5b06b..2a02cc2 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -201,6 +201,12 @@ Additions include: attachments in directories that are hard to navigate to, or that are accessed frequently. +
  • When a filename is attached and its name is encoded, the save + attachment command will offer to save the file in the encoded form. + This might work for some users, but the save command will have a + subcommand ^N to decode the file name and save the file with the + decoded name. +
  • Ignore message from smtp server after a successful authentication challenge. -- 2.11.4.GIT