Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit e5ccdb10 authored by Rob Swindell's avatar Rob Swindell 💬

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

For files with names > 64 chars.
parent 2eb90776
Pipeline #1950 passed with stage
in 8 minutes and 41 seconds
......@@ -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)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment