From 6d6925b38c6db748cf66101a8039b81292c9e70c Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Tue, 18 Jan 2022 01:16:16 -0800 Subject: [PATCH] Don't display "blank" extended description in listings If an extended description contains nothing but Ctrl-A codes and white-space, don't display it in a file listing (in place of the normal short description). --- src/sbbs3/listfile.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/sbbs3/listfile.cpp b/src/sbbs3/listfile.cpp index 629dbca9bf..3450030834 100644 --- a/src/sbbs3/listfile.cpp +++ b/src/sbbs3/listfile.cpp @@ -340,10 +340,18 @@ bool sbbs_t::listfile(file_t* f, uint dirnum, const char *search, const char let off_t cdt; int size_attr=clr_filecdt; - if(f->extdesc != NULL && *f->extdesc && (useron.misc&EXTDESC)) { - ext = f->extdesc; - if((useron.misc&BATCHFLAG) && lncntr+extdesclines(ext)>=rows-2 && letter!='A') - return false; + if(useron.misc & EXTDESC) { + if(f->extdesc != NULL && (ext = strdup(f->extdesc)) != NULL) { + strip_ctrl(ext, ext); + truncsp(ext); + char ch = *ext; + FREE_AND_NULL(ext); + if(ch != '\0') { + ext = f->extdesc; + if((useron.misc&BATCHFLAG) && lncntr+extdesclines(ext)>=rows-2 && letter!='A') + return false; + } + } } cond_newline(); -- GitLab