mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-09-28 01:55:12 +00:00
ATTACHER: Fix #53 - MIME name is now just the filename (no path)
This commit is contained in:
parent
3189c7a46c
commit
a3099887a9
@ -613,6 +613,23 @@ done:
|
||||
cursor(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return pointer to start of the filename portion of a full path.
|
||||
* /FOO/BAR/BAZ -> BAZ
|
||||
*/
|
||||
char *shortfilename(char *fullfilename) {
|
||||
uint8_t i = 0;
|
||||
int8_t lastslash = -1;
|
||||
while (fullfilename[i]) {
|
||||
if (fullfilename[i] == '/')
|
||||
lastslash = i;
|
||||
++i;
|
||||
}
|
||||
if (lastslash == -1)
|
||||
return fullfilename;
|
||||
return fullfilename + lastslash + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Optionally attach files to outgoing email.
|
||||
* filename - Name of file containing email message
|
||||
@ -739,7 +756,7 @@ ask:
|
||||
latest->next = malloc(sizeof(struct attachinfo));
|
||||
latest = latest->next;
|
||||
}
|
||||
strcpy(latest->filename, userentry);
|
||||
strcpy(latest->filename, shortfilename(userentry));
|
||||
latest->size = size;
|
||||
latest->next = NULL;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PROGNAME "emai//er v2.1.2"
|
||||
#define PROGNAME "emai//er v2.1.3"
|
||||
|
||||
// Configuration params from EMAIL.CFG
|
||||
char cfg_server[40]; // IP of POP3 server
|
||||
|
Loading…
Reference in New Issue
Block a user