Commit 4b55d180 authored by rswindell's avatar rswindell
Browse files

write_flofile(): if the 'infile' path contains a drive letter prefix

(e.g. "C:"), skip it on *nix and if the path contains backslashes, convert
to forward-slashes (for all OSes). This resolves an issue of sending a
netmail file-attachment that was created on a Windows/MS-DOS type system
and then scanned/exported on a *nix system. The FTN "stored message"
convention is to have the full path of the attached file in the message
subject.

Hopefully nobody wants to use outbound directory names beginning with "x:"
on *nix. :-)
parent 5d1e28b5
......@@ -814,6 +814,7 @@ int write_flofile(const char *infile, fidoaddr_t dest, bool bundle, bool use_out
const char* flo_filename;
char attachment[MAX_PATH+1];
char searchstr[MAX_PATH+1];
char* p;
FILE *fp;
nodecfg_t* nodecfg;
......@@ -829,7 +830,12 @@ int write_flofile(const char *infile, fidoaddr_t dest, bool bundle, bool use_out
if(flo_filename == NULL)
return -2;
#ifdef __unix__
if(isalpha(infile[0]) && infile[1] == ':') // Ignore "C:" prefix
infile += 2;
#endif
SAFECOPY(attachment, infile);
REPLACE_CHARS(attachment, '\\', '/', p);
if(!fexistcase(attachment)) { /* just in-case it's the wrong case for a Unix file system */
lprintf(LOG_ERR, "ERROR line %u, attachment file not found: %s", __LINE__, attachment);
return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment