$Log$
+ Revision 610.21 2003/10/14 03:09:47 ajc
+ * routines2.c: fixed an off-by-one error in filename sanitization for
+ client file uploads
+
Revision 610.20 2003/10/10 05:43:57 ajc
* citadel.c: Reworded one of the prompts
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
/* basename of filename */
strcpy(tbuf, flnm);
if (haschar(tbuf, '/'))
- strcpy(tbuf, strrchr(tbuf, '/'));
+ extract_token(tbuf, flnm,
+ num_tokens(tbuf, '/') - 1,
+ '/'
+ );
/* filename.1, filename.2, etc */
if (a > 0) {
- sprintf(buf + strlen(buf), ".%d", a);
+ sprintf(&tbuf[strlen(tbuf)], ".%d", a);
}
/* Try upload */
r = CtdlIPCFileUpload(ipc, tbuf, desc, flnm, progress, buf);
else
break;
++a;
- };
+ }
+ if (a > 0) scr_printf("Saved as '%s'\n", tbuf);
}