Commit bb3596e9 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Increase file_id.diz max line length from 80 to 255

Increase total extended description length from 1024 to 4000 characters. Perhaps this should be configurable?
parent e86af92d
......@@ -125,7 +125,7 @@ bool get_file_diz(file_t* f, char* ext, size_t maxlen)
return false;
}
printf("Parsing DIZ: %s\n", diz_fpath);
str_list_t lines = read_diz(diz_fpath, /* max_line_len: */80);
str_list_t lines = read_diz(diz_fpath);
format_diz(lines, ext, maxlen, /* allow_ansi: */false);
strListFree(&lines);
remove(diz_fpath);
......
......@@ -923,13 +923,13 @@ bool extract_diz(scfg_t* cfg, file_t* f, str_list_t diz_fnames, char* path, size
return false;
}
str_list_t read_diz(const char* path, size_t max_line_len)
str_list_t read_diz(const char* path)
{
FILE* fp = fopen(path, "r");
if(fp == NULL)
return NULL;
str_list_t lines = strListReadFile(fp, NULL, max_line_len);
str_list_t lines = strListReadFile(fp, NULL, /* max_line_len: */255);
fclose(fp);
return lines;
}
......
......@@ -56,7 +56,7 @@ DLLEXPORT bool addfile(scfg_t*, uint dirnum, file_t*, const char* extdesc);
DLLEXPORT bool removefile(scfg_t*, uint dirnum, const char* filename);
DLLEXPORT char* format_filename(const char* fname, char* buf, size_t, bool pad);
DLLEXPORT bool extract_diz(scfg_t*, file_t*, str_list_t diz_fname, char* path, size_t);
DLLEXPORT str_list_t read_diz(const char* path, size_t max_line_len);
DLLEXPORT str_list_t read_diz(const char* path);
DLLEXPORT char* format_diz(str_list_t lines, char*, size_t maxlen, bool allow_ansi);
DLLEXPORT char* prep_file_desc(const char *src, char* dst);
......
......@@ -1075,7 +1075,7 @@ static void receive_thread(void* arg)
lprintf(LOG_DEBUG,"%04d <%s> DATA Extracting DIZ from: %s",xfer.ctrl_sock, xfer.user->alias,xfer.filename);
if(extract_diz(&scfg, &f, /* diz_fnames */NULL, tmp, sizeof(tmp))) {
lprintf(LOG_DEBUG,"%04d <%s> DATA Parsing DIZ: %s",xfer.ctrl_sock, xfer.user->alias,tmp);
str_list_t lines = read_diz(tmp, /* max_line_len: */80);
str_list_t lines = read_diz(tmp);
format_diz(lines, extdesc, sizeof(extdesc), /* allow_ansi: */false);
strListFree(&lines);
if(!fdesc[0]) { /* use for normal description */
......
......@@ -969,7 +969,7 @@ static void get_diz(scfg_t* scfg, file_t* file, char** extdesc)
char diz_fpath[MAX_PATH + 1];
if(extract_diz(scfg, file, /* diz_fnames: */NULL, diz_fpath, sizeof(diz_fpath))) {
char extbuf[LEN_EXTDESC + 1] = "";
str_list_t lines = read_diz(diz_fpath, /* max_line_len: */80);
str_list_t lines = read_diz(diz_fpath);
if(lines != NULL) {
format_diz(lines, extbuf, sizeof(extbuf), /* allow_ansi: */false);
strListFree(&lines);
......
......@@ -505,8 +505,8 @@ typedef enum { /* Values for xtrn_t.event */
#define LEN_LOCATION 30 /* Location (City, State) */
#define LEN_ZIPCODE 10 /* Zip/Postal code */
#define LEN_MODEM 8 /* User modem type description */
#define LEN_FDESC 58 /* File description */
#define LEN_EXTDESC 1024 /* extended file description */
#define LEN_FDESC 58 /* File description (summary) */
#define LEN_EXTDESC 4000 /* Extended file description */
#define LEN_TITLE 70 /* Message title */
#define LEN_MAIN_CMD 28 /* Unused Storage in user.dat */
#define LEN_COLS 3
......
......@@ -154,7 +154,7 @@ bool sbbs_t::uploadfile(file_t* f)
if(extract_diz(&cfg, f, /* diz_fnames: */NULL, str, sizeof(str))) {
lprintf(LOG_DEBUG, "Parsing DIZ: %s", str);
str_list_t lines = read_diz(str, /* max_line_len: */80);
str_list_t lines = read_diz(str);
if(lines != NULL)
format_diz(lines, ext, sizeof(ext), /* allow_ansi: */false);
strListFree(&lines);
......
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