From 214442a1a19dbf18732969b43781702347a2f085 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 13 Aug 2009 21:43:07 +0000
Subject: [PATCH] Prevent possible unkludging bug.  This is unlikely to
 actually fix the real problem however.

---
 exec/fseditor.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/exec/fseditor.js b/exec/fseditor.js
index 4ae058d8e0..1c9b651168 100644
--- a/exec/fseditor.js
+++ b/exec/fseditor.js
@@ -266,8 +266,13 @@ function unwrap_line(l)
 				line[l].kludged=false;
 		}
 		/* Get first word(s) of next line */
-		re=new RegExp("^(.{1,"+space+"}(?![^\\s])\\s*)","");
-		words=line[l+1].text.match(re);
+		if(space < 1) {
+			words=null;
+		}
+		else {
+			re=new RegExp("^(.{1,"+space+"}(?![^\\s])\\s*)","");
+			words=line[l+1].text.match(re);
+		}
 		if(words != null) {
 			line[l].text+=words[1];
 			line[l].attr+=line[l+1].attr.substr(0,words[1].length);
@@ -1898,4 +1903,4 @@ if(edit_top==5 && info[0]!=subj) {
 console.ctrlkey_passthru=oldpass;
 bbs.sys_status=old_status;
 console.clear();
-exit(exit_code);
\ No newline at end of file
+exit(exit_code);
-- 
GitLab