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

Increase maximum file extension length from 3 to 15 characters

For Viewable, Testable, Compressible file types and download events,
the file extension is no longer limited to 3 characters. 15 characters
seemed like "enough".

Similarly, a user's temp/QWK file type preference is also extended from
3 to 15 characters.

This fixes issue #486, but file types such as *.tar.gz (2 dots in the extension)
are still an issue and will be addressed next.
parent 28cfca28
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@
#define FNOPEN_BUF_SIZE (2*1024)
#define MAX_FILENAME_LEN 64
#define MAX_FILEEXT_LEN 15
#define ILLEGAL_FILENAME_CHARS "\\/|<>:\";,%?*"
#define SAFEST_FILENAME_CHARS "-._0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
......@@ -925,7 +926,7 @@ typedef struct { /* Users information */
phone[LEN_PHONE+1], /* Phone number xxx-xxx-xxxx format */
modem[LEN_MODEM+1], /* Modem type - 8 chars max */
netmail[LEN_NETMAIL+1], /* NetMail forwarding address */
tmpext[4], /* QWK Packet extension */
tmpext[MAX_FILEEXT_LEN+1], /* QWK Packet / Temp file type */
comment[LEN_COMMENT+1], /* Private comment about user */
cursub[LEN_EXTCODE+1], /* Current sub-board internal code */
curdir[LEN_EXTCODE+1], /* Current directory internal code */
......
......@@ -329,7 +329,7 @@ void xfer_opts()
case __COUNTER__: /* Viewable file types */
while(1) {
for(i=0;i<cfg.total_fviews && i<MAX_OPTS;i++)
sprintf(opt[i],"%-3.3s %-40s",cfg.fview[i]->ext,cfg.fview[i]->cmd);
sprintf(opt[i],"%-*s %-40s", MAX_FILEEXT_LEN, cfg.fview[i]->ext, cfg.fview[i]->cmd);
opt[i][0]=0;
i=WIN_RHT|WIN_ACT|WIN_SAV; /* save cause size can change */
if(cfg.total_fviews<MAX_OPTS)
......@@ -465,7 +465,7 @@ void xfer_opts()
case __COUNTER__: /* Testable file types */
while(1) {
for(i=0;i<cfg.total_ftests && i<MAX_OPTS;i++)
sprintf(opt[i],"%-3.3s %-40s",cfg.ftest[i]->ext,cfg.ftest[i]->cmd);
sprintf(opt[i],"%-*s %-40s", MAX_FILEEXT_LEN, cfg.ftest[i]->ext, cfg.ftest[i]->cmd);
opt[i][0]=0;
i=WIN_RHT|WIN_ACT|WIN_SAV; /* save cause size can change */
if(cfg.total_ftests<MAX_OPTS)
......@@ -599,7 +599,7 @@ void xfer_opts()
case __COUNTER__: /* Download Events */
while(1) {
for(i=0;i<cfg.total_dlevents && i<MAX_OPTS;i++)
sprintf(opt[i],"%-3.3s %-40s",cfg.dlevent[i]->ext,cfg.dlevent[i]->cmd);
sprintf(opt[i],"%-*s %-40s", MAX_FILEEXT_LEN, cfg.dlevent[i]->ext, cfg.dlevent[i]->cmd);
opt[i][0]=0;
i=WIN_RHT|WIN_ACT|WIN_SAV; /* save cause size can change */
if(cfg.total_dlevents<MAX_OPTS)
......@@ -747,8 +747,8 @@ void xfer_opts()
case __COUNTER__: /* Extractable file types */
while(1) {
for(i=0;i<cfg.total_fextrs && i<MAX_OPTS;i++)
sprintf(opt[i],"%-3.3s %-40s"
,cfg.fextr[i]->ext,cfg.fextr[i]->cmd);
sprintf(opt[i],"%-*s %-40s"
,MAX_FILEEXT_LEN, cfg.fextr[i]->ext, cfg.fextr[i]->cmd);
opt[i][0]=0;
i=WIN_RHT|WIN_ACT|WIN_SAV; /* save cause size can change */
if(cfg.total_fextrs<MAX_OPTS)
......@@ -882,7 +882,7 @@ void xfer_opts()
case __COUNTER__: /* Compressible file types */
while(1) {
for(i=0;i<cfg.total_fcomps && i<MAX_OPTS;i++)
sprintf(opt[i],"%-3.3s %-40s",cfg.fcomp[i]->ext,cfg.fcomp[i]->cmd);
sprintf(opt[i],"%-*s %-40s",MAX_FILEEXT_LEN, cfg.fcomp[i]->ext, cfg.fcomp[i]->cmd);
opt[i][0]=0;
i=WIN_RHT|WIN_ACT|WIN_SAV; /* save cause size can change */
if(cfg.total_fcomps<MAX_OPTS)
......
......@@ -239,7 +239,7 @@ typedef struct { /* Transfer Protocol information */
} prot_t;
typedef struct { /* Extractable file types */
char ext[4]; /* Extension */
char ext[MAX_FILEEXT_LEN+1]; /* Extension */
char arstr[LEN_ARSTR+1], /* Access Requirements */
cmd[LEN_CMD+1]; /* Command line */
uchar ar[LEN_ARSTR+1];
......@@ -247,7 +247,7 @@ typedef struct { /* Extractable file types */
} fextr_t;
typedef struct { /* Compressable file types */
char ext[4]; /* Extension */
char ext[MAX_FILEEXT_LEN+1]; /* Extension */
char arstr[LEN_ARSTR+1], /* Access Requirements */
cmd[LEN_CMD+1]; /* Command line */
uchar ar[LEN_ARSTR+1];
......@@ -255,7 +255,7 @@ typedef struct { /* Compressable file types */
} fcomp_t;
typedef struct { /* Viewable file types */
char ext[4]; /* Extension */
char ext[MAX_FILEEXT_LEN+1]; /* Extension */
char arstr[LEN_ARSTR+1], /* Access Requirements */
cmd[LEN_CMD+1]; /* Command line */
uchar ar[LEN_ARSTR+1];
......@@ -263,7 +263,7 @@ typedef struct { /* Viewable file types */
} fview_t;
typedef struct { /* Testable file types */
char ext[4]; /* Extension */
char ext[MAX_FILEEXT_LEN+1]; /* Extension */
char arstr[LEN_ARSTR+1], /* Access requirement */
cmd[LEN_CMD+1], /* Command line */
workstr[41]; /* String to display while working */
......@@ -272,7 +272,7 @@ typedef struct { /* Testable file types */
} ftest_t;
typedef struct { /* Download events */
char ext[4];
char ext[MAX_FILEEXT_LEN+1]; /* Extension */
char arstr[LEN_ARSTR+1], /* Access requirement */
cmd[LEN_CMD+1], /* Command line */
workstr[41]; /* String to display while working */
......@@ -325,7 +325,7 @@ typedef struct { /* QWK Network Hub */
call[LEN_CMD+1], /* Call-out command line to execute */
pack[LEN_CMD+1], /* Packing command line */
unpack[LEN_CMD+1]; /* Unpacking command line */
char fmt[4]; /* Archive format */
char fmt[MAX_FILEEXT_LEN+1]; /* Archive format */
uint16_t time, /* Time to call-out */
node, /* Node to do the call-out */
freq, /* Frequency of call-outs */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment