Skip to content
Snippets Groups Projects
Commit b261ffd3 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

get_size() and get_path() methods need to read the header record too

For files with names > 64 chars.
parent 3f69bab5
Branches
Tags
No related merge requests found
...@@ -849,7 +849,7 @@ js_get_file_path(JSContext *cx, uintN argc, jsval *arglist) ...@@ -849,7 +849,7 @@ js_get_file_path(JSContext *cx, uintN argc, jsval *arglist)
return JS_TRUE; return JS_TRUE;
rc=JS_SUSPENDREQUEST(cx); 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]; char path[MAX_PATH + 1];
JSString* js_str; JSString* js_str;
if((js_str = JS_NewStringCopyZ(cx, getfilepath(scfg, &file, path))) != NULL) 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) ...@@ -901,7 +901,7 @@ js_get_file_size(JSContext *cx, uintN argc, jsval *arglist)
return JS_TRUE; return JS_TRUE;
rc=JS_SUSPENDREQUEST(cx); 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]; char path[MAX_PATH + 1];
getfilepath(scfg, &file, path); getfilepath(scfg, &file, path);
JS_SET_RVAL(cx, arglist, DOUBLE_TO_JSVAL((jsdouble)getfilesize(scfg, &file))); JS_SET_RVAL(cx, arglist, DOUBLE_TO_JSVAL((jsdouble)getfilesize(scfg, &file)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment