From 291ff7b10f8c13dac128b8eca8e8209a714845ca Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Mon, 28 Jun 2021 17:55:06 -0700
Subject: [PATCH] Don't load() 822header.js unless we're exporting messages

822header.js adds an enumerable method to the header object which ends up in the output when using the -hdrs option/command.

This addresses issue #277

Note: this is not actually a supported or documented script.
---
 exec/msgutil.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec/msgutil.js b/exec/msgutil.js
index 822ee159ec..6b4343ef3a 100644
--- a/exec/msgutil.js
+++ b/exec/msgutil.js
@@ -3,7 +3,6 @@
 "use strict";
 
 load('sbbsdefs.js');
-load('822header.js');
 
 function show_index(msgbase, first_msg, last_msg, include_votes)
 {
@@ -61,6 +60,7 @@ function export_msgs(msgbase, option)
 	var errors = 0;
 	var hdrs = msgbase.get_all_msg_headers(option.votes);
 	var i;
+	load('822header.js');
 	for(i in hdrs) {
 		var msg = hdrs[i];
 		var fname = system.temp_dir + basecode + "_" + msg.number + ".txt";
-- 
GitLab