From bae44ecb3638448ee598ff8710e04e43cc0ef379 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 28 Feb 2008 02:27:25 +0000
Subject: [PATCH] Search for the NEWEST quotes.txt file in the node directory.

---
 exec/fseditor.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/exec/fseditor.js b/exec/fseditor.js
index 9fc43192ff..1e5df600af 100644
--- a/exec/fseditor.js
+++ b/exec/fseditor.js
@@ -1809,6 +1809,22 @@ if(input_filename==undefined) {
 	if(argc==1 && input_filename==undefined)
 		input_filename=argv[0];
 }
+else {
+	var all_files=directory(system.node_dir+"*");
+	var newest_filedate=-Infinity;
+	var newest_filename;
+	for(var file in all_files) {
+		if(all_files[file].search(/quotes.txt$/i)!=-1) {
+			var this_date=file_date(all_files[file]);
+			if(this_date > newest_filedate) {
+				newest_filename=all_files[file];
+				newest_filedate=this_date;
+			}
+		}
+	}
+	if(newest_filename != undefined)
+		input_filename=newest_filename;
+}
 bbs.sys_status&=~SS_PAUSEON;
 bbs.sys_status|=SS_PAUSEOFF;
 var oldpass=console.ctrlkey_passthru;
-- 
GitLab