mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-06-27 22:29:28 +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);
|
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.
|
* Optionally attach files to outgoing email.
|
||||||
* filename - Name of file containing email message
|
* filename - Name of file containing email message
|
||||||
|
@ -739,7 +756,7 @@ ask:
|
||||||
latest->next = malloc(sizeof(struct attachinfo));
|
latest->next = malloc(sizeof(struct attachinfo));
|
||||||
latest = latest->next;
|
latest = latest->next;
|
||||||
}
|
}
|
||||||
strcpy(latest->filename, userentry);
|
strcpy(latest->filename, shortfilename(userentry));
|
||||||
latest->size = size;
|
latest->size = size;
|
||||||
latest->next = NULL;
|
latest->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define PROGNAME "emai//er v2.1.2"
|
#define PROGNAME "emai//er v2.1.3"
|
||||||
|
|
||||||
// Configuration params from EMAIL.CFG
|
// Configuration params from EMAIL.CFG
|
||||||
char cfg_server[40]; // IP of POP3 server
|
char cfg_server[40]; // IP of POP3 server
|
||||||
|
|
Loading…
Reference in New Issue
Block a user