summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2016-05-12 21:50:48 -0600
committerEduardo Chappa <chappa@washington.edu>2016-05-12 21:50:48 -0600
commit398178c265ff68ceeafa6a84089bc01ae949e314 (patch)
treee27e7539f44d0802a5d1379f317a2283032ddd1a
parentb74b7a0d9eb48dbe3ea773885135ecb924d8a902 (diff)
downloadalpine-398178c265ff68ceeafa6a84089bc01ae949e314.tar.xz
* 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.
-rw-r--r--alpine/mailcmd.c19
-rw-r--r--pith/pine.hlp6
2 files changed, 22 insertions, 3 deletions
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c
index 4d519897..5e95d334 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 af5b06b7..2a02cc2b 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.
+ <LI> 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.
+
<LI> Ignore message from smtp server after a successful authentication
challenge.