• src/sbbs3/filedat.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 3 19:11:06 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/0553ef9b362cd580092cade6
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    The simpler fix to issue #317 (nested DIZ files)

    By extracting with with_path=true, the file_list matching won't match the nested DIZ files.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Jan 10 19:55:52 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/60e4d7af2800557e2435af16
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    loadfiles() will perform liberal filename matching when len > 12 chars

    As discovered while making the Synchronet v3.18b feature video (https://www.youtube.com/watch?v=_IWzIV0_sZ4), when only a shortened version of a long filename is displayed (e.g. due to 80 column terminal width limitations), trying to download that filename by specifying the filename at the Download File(s) Filespec [All Files]: prompt can be problematic.

    For example (as seen in the video), the file "SyncTERM-1.1-setup.exe" is displayed as "SyncTERM.exe" (on an 80-column terminal), yet trying to download "SyncTERM.exe" (or "syncterm.exe") using the 'D'ownload command would fail to find a file with that name (understandably, but frustratingly so).

    This change will transform the requested filename-to-load if it is at least 12 characters in length and contains no wildcards (* or ?), to include a filename extending wildcard: "filename.txt" will become "filename*.txt" and "longfilename" will become "longfilename*".

    For requested filespecs of NULL (all files) or specs containing wildcards or specs (filenames) less than 12 characters in length, no filespec transform takes place: so trying to list/download "a" doesn't match "apple.txt".

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Jan 13 19:06:35 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/063d470031c30c732d27caf8
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Address Coverty reported issue about dereferencing a NULL pointer

    CID 345291
    It's actually a false positive because if an extension (".suffix") exists in filespec, it must also exist in newfilespec since it's a copy, but whatever. It's better form to check.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jan 15 20:14:02 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/27f8668cd1429dd8b03b87af
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fix printf format issue in previous commit.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jan 23 13:44:55 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/77e2d88edb57a1f4c06ee4ed
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    create_archive() will skip directories in supplied file_list

    The file_list[] parameter was expected to contain only files, but the directory() function (used to create that file_list[]) returns a list of all directory entries, including sub-directories. I could (and maybe will) add an option to directory() to only include files or dirs, but this seemed the more direct fix for the problem reported by DesotoFireflite (VALHALLA):

    TickIT's nodelist_handler.js appears to be creating and leaving behind a sub-directory of the temp directory, triggering this error:
    1/23 11:36:56a QNET libarchive error -1 (13 opening c:\SBBS\temp\event\nodelist_handler/) creating c:\SBBS\data\VERT.REP

    Why isn't the temp directory fully cleaned up after/between events? That's another thing to look into.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Feb 23 00:19:23 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/067556d75a33774e350ecae7
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Strip CP437 "graphics" characters in prep_file_desc()

    If the extended description is UTF-8, first convert it to CP437.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Mar 1 22:43:08 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/4bb4130cd565b4945a999f43
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Add some NULL argument value checking

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Mar 29 20:18:45 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/59200e330f416573be8a49d1
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Some archives don't have DIZ in the root directory

    (I'm looking at you, mist1221.zip)

    ... so first try to extract DIZ files from the root of the archive, then try again searching nested directories too. <sigh>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Mar 31 18:59:38 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/67d3c3e2c8db7368570944e2
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fix file list sorting by date, need to use the index not the header

    When loadfiles() calls sortfiles(), only the file's index records have been read in, so trying to sort on any header field won't work.

    This bug wasn't observable when sorting by date ascending, since that's the natural index order of the files already (order imported/added), only
    observed when sorting by date descending (newest at the top).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Aug 2 17:20:24 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/bff68ad04b5051effdd82bb0
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Check max_files value in extract_files_from_archive() better

    Address issue reported by Nightfox via DOVE-Net:
    Today I was using the Archive class to extract exactly one file from a zip file, and I'm a little confused on the exception throwing behavior regarding the max_files parameter. When calling extract(), I gave it a filename pattern and expected exactly 1 file to be extracted, so I also gave a max_files argument as 1. It extracted the one file, but it threw an exception with the error "Error: maximum number of files (1) extracted (after extracting 1 item successfully)".

    Should that be an error condition to throw an exception? I expected 1 file to be extracted, and that file was extracted successfully. If I specify max_files as 2, then it doesn't throw an exception.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sat Feb 4 17:13:14 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ef2fa232ddcb2cef11c7458a
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    If filename_maxlen is 0, don't use it enforce a maximum filename length

    This is just extra paranoia now since the reading of file.ini enforces the value range
    8 <-> 65535 now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (in GitKraken)@VERT to Git commit to main/sbbs/master on Thu Mar 2 18:56:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/9a57677a496ff570f4038cd2
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Avoid possible divide-by-zero in gettimetodl()

    Default to 100000 (cps) if passed a rate_cps argument value of 0.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Feb 12 10:27:35 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/31ded19d6a8e8933b9f999e4
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Resolve warning: enumeration value ‘FILE_SORT_NATURAL’ not handled in switch

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Fri May 3 17:35:57 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/e2d3cd89bba7f5556c6245e2
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Fixup extract_diz() - fallback to external archivers

    The fallback to external extractors/archivers didn't really work unless a libarchive function (called from extract_files_from_archive) actually failed and the return value was < 0. A return value of 0 would mean the external
    file extractor would never be used.

    This was discovered when trying to import DIZ from old ZIP files (from 1992) that used "Implode" compression method for the FILE_ID.DIZ, which is a compression method *not* supported by libarchive. This is a reason why sysops might want to leave Info-zip's 'unzip' as a configured Extractable File Type handler (in SCFG) for 'zip' files.

    Don't call the external archiver 3 times for the 3 DIZ filenames supported. Just call the external archiver once, and pass all 3 filesnames. This also means that the call to system() can return non-zero (e.g. Info-zip 'unzip'
    will return 2 if any of the files aren't present in the archive, even if
    one is) - so ignore this return value from system(). This speeds up bulk
    import (e.g. using addfiles.js).

    Unfortunately, I couldn't really find a nice cross-platform way to suppress
    the unzip "caution: filename not matched" message sent to stderr. That's
    a bummer and a little annoying.

    Ignore 0-length DIZ files.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sun Jun 9 16:39:59 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/50b4ff0a10cf4efacb49ab0e
    Modified Files:
    src/sbbs3/filedat.c
    Log Message:
    Replace line-feeds with space in extended descriptions used for short desc

    Fixes cosmetic/readability issue when imported DIZ files that have line/word wrapped text and the space between words was being removed.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net