From 532fe42e9f6f30cba9249c6d2ae3d4044e5644a1 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Thu, 11 Aug 2016 00:49:50 +0000 Subject: [PATCH] Bug-fix: For outbound files destined for foreign zones, don't chop off the character of the default outbound directory *unless* it is a path delimiter (e.g. / or \) - for BSO only. Also minor optimization: don't call mkpath() unless isdir() returns false (on the outbound directory). --- src/sbbs3/sbbsecho.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sbbs3/sbbsecho.c b/src/sbbs3/sbbsecho.c index 977b334c97..d6b1b7dcfd 100644 --- a/src/sbbs3/sbbsecho.c +++ b/src/sbbs3/sbbsecho.c @@ -350,7 +350,9 @@ int get_outbound(fidoaddr_t dest, char* outbound, size_t maxlen, bool fileboxes) strncpy(outbound, nodecfg->outbox, maxlen); else if(cfg.flo_mailer) { if(dest.zone != sys_faddr.zone) { /* Inter-zone outbound is "OUTBOUND.ZZZ/" */ - *lastchar(outbound) = 0; + char* p = lastchar(outbound); + if(IS_PATH_DELIM(*p)) + *p = 0; safe_snprintf(outbound+strlen(outbound), maxlen,".%03x", dest.zone); } if(dest.point != 0) { /* Point destination is "OUTBOUND[.ZZZ]/NNNNnnnn.pnt/" */ @@ -359,8 +361,9 @@ int get_outbound(fidoaddr_t dest, char* outbound, size_t maxlen, bool fileboxes) } } backslash(outbound); - if(!isdir(outbound)) - lprintf(LOG_DEBUG, "Creating outbound directory for %s: %s", smb_faddrtoa(&dest, NULL), outbound); + if(isdir(outbound)) + return 0; + lprintf(LOG_DEBUG, "Creating outbound directory for %s: %s", smb_faddrtoa(&dest, NULL), outbound); return mkpath(outbound); } -- GitLab