I posted the first 2 issues in boinc_projects, I think they may have been
fixed already...
all are for the boinc_make_dirs function:
1) parameter type declaration in filesys.h does not match filesys.cpp.
filesys.h should be 'const char *' for both parameters
2) method body in filesys.cpp doesn't make use of parameter dirpath --
oldpath should be init'd to dirpath
3) (new) if filepath parameter is a/b/c, then the 'c' directory will not be
created; the while loop breaks too soon.
This is my fixed function body:
int boinc_make_dirs(const char* dirpath, const char* filepath) {
char buf[1024], oldpath[1024], newpath[1024];
int retval;
char *p, *q;
if (strlen(filepath) + strlen(dirpath) > 1023) return ERR_BUFFER_OVERFLOW;
strcpy(buf, filepath);
strcpy(oldpath, dirpath);
q = buf;
while(*q) {
p = strchr(q, '/');
if (p) *p = 0;
sprintf(newpath, "%s/%s", oldpath, q);
retval = boinc_mkdir(newpath);
if (retval) return retval;
strcpy(oldpath, newpath);
if (p) q = p+1;
else break;
}
return 0;
}
Thanks,
Josh
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.