From 01fbd6faa74adb3aaf011a06f0af9e63b1da79bd Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Fri, 27 Nov 2020 20:19:04 -0800
Subject: [PATCH] Trim white-space from the start of stderr-logged string from
 xtrns

... like the last commit that did this, but do in the other 2 places where
stderr output is logged as log messages.
Also, include the extended program name in the stderr log messages, making it
easier to find the output you're looking for.
---
 src/sbbs3/xtrn.cpp | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/sbbs3/xtrn.cpp b/src/sbbs3/xtrn.cpp
index a0afdcd672..ac9e08bad4 100644
--- a/src/sbbs3/xtrn.cpp
+++ b/src/sbbs3/xtrn.cpp
@@ -1673,9 +1673,11 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
 				}
 				if(i > 0) {
 					buf[i] = '\0';
-					truncsp((char*)buf);
-					if(*buf)
-						lprintf(LOG_NOTICE, "%s", buf);
+					p = (char*)buf;
+					truncsp(p);
+					SKIP_WHITESPACE(p);
+					if(*p)
+						lprintf(LOG_NOTICE, "%s: %s", fname, p);
 				}
 
 				/* Eat stderr if mode is EX_BIN */
@@ -1789,7 +1791,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
 						truncsp(p);
 						SKIP_WHITESPACE(p);
 						if(*p)
-							lprintf(LOG_NOTICE, "%s", p);
+							lprintf(LOG_NOTICE, "%s: %s", fname, p);
 						i=0;
 						bp=buf;
 					}
@@ -1801,9 +1803,11 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
 			}
 			if(i > 0) {
 				buf[i] = '\0';
-				truncsp((char*)buf);
-				if(*buf)
-					lprintf(LOG_NOTICE, "%s", buf);
+				p = (char*)buf;
+				truncsp(p);
+				SKIP_WHITESPACE(p);
+				if(*p)
+					lprintf(LOG_NOTICE, "%s: %s", fname, p);
 			}
 		}
 	}
-- 
GitLab