From b261ffd334d25cf22b32d90b81b2535c206a0d7e Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Sun, 18 Apr 2021 17:00:42 -0700
Subject: [PATCH] get_size() and get_path() methods need to read the header
 record too

For files with names > 64 chars.
---
 src/sbbs3/js_filebase.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/js_filebase.c b/src/sbbs3/js_filebase.c
index ed415a7ac0..f6bfbd45c1 100644
--- a/src/sbbs3/js_filebase.c
+++ b/src/sbbs3/js_filebase.c
@@ -849,7 +849,7 @@ js_get_file_path(JSContext *cx, uintN argc, jsval *arglist)
 		return JS_TRUE;
 
 	rc=JS_SUSPENDREQUEST(cx);
-	if((p->smb_result = smb_loadfile(&p->smb, filename, &file, file_detail_index)) == SMB_SUCCESS) {
+	if((p->smb_result = smb_loadfile(&p->smb, filename, &file, file_detail_normal)) == SMB_SUCCESS) {
 		char path[MAX_PATH + 1];
 		JSString* js_str;
 		if((js_str = JS_NewStringCopyZ(cx, getfilepath(scfg, &file, path))) != NULL)
@@ -901,7 +901,7 @@ js_get_file_size(JSContext *cx, uintN argc, jsval *arglist)
 		return JS_TRUE;
 
 	rc=JS_SUSPENDREQUEST(cx);
-	if((p->smb_result = smb_loadfile(&p->smb, filename, &file, file_detail_index)) == SMB_SUCCESS) {
+	if((p->smb_result = smb_loadfile(&p->smb, filename, &file, file_detail_normal)) == SMB_SUCCESS) {
 		char path[MAX_PATH + 1];
 		getfilepath(scfg, &file, path);
 	    JS_SET_RVAL(cx, arglist, DOUBLE_TO_JSVAL((jsdouble)getfilesize(scfg, &file)));
-- 
GitLab