• src/sbbs3/js_file.c

    From rswindell@VERT to CVS commit on Sun Apr 5 22:21:02 2020
    src/sbbs3 js_file.c 1.190 1.191
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv9740

    Modified Files:
    js_file.c
    Log Message:
    Don't try to convert null or undefined arguments to integers.
    Moved some dbprintf() lines around a bit.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Mon Apr 6 18:31:21 2020
    src/sbbs3 js_file.c 1.191 1.192
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv15683

    Modified Files:
    js_file.c
    Log Message:
    Special handling of negative numbers in the writeBin() method implementation. JS numbers are double-precision floating points (doubles) and doubles cannot
    be converted to unsigned integers uniformly across all architectures (e.g. specifically on ARM, negative numbers would mostly get converted to 0U).

    For details, see https://www.embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int/


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sat Apr 11 19:25:31 2020
    src/sbbs3 js_file.c 1.192 1.193
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv18066

    Modified Files:
    js_file.c
    Log Message:
    Added optional "lowercase" argument to File.iniGetObject() and iniGetAllObjects() to sort of "normalize" the key names into easily-useable (and consistent) JavaScript property names.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Apr 12 00:27:25 2020
    src/sbbs3 js_file.c 1.193 1.194
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv428

    Modified Files:
    js_file.c
    Log Message:
    Restore the previous behavior of File.iniGetObject(null), even though not documented (it says if the section is *undefined*, the root section is read)


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Apr 12 00:58:01 2020
    src/sbbs3 js_file.c 1.194 1.195
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv4839

    Modified Files:
    js_file.c
    Log Message:
    Document the iniGetObject(null) behavior.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thu Apr 16 22:37:14 2020
    src/sbbs3 js_file.c 1.195 1.196
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv894

    Modified Files:
    js_file.c
    Log Message:
    Update to File.iniGetAllObjects(): read the .ini file all in one go using iniReadFile():
    - enables the use of the !include directive in the read .in file
    - reduces rewinds/re-reads of the .ini file, speeding up the total operation

    I also removed the old crash dump comments from here.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Fri Nov 13 13:55:10 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/1af02470226933aa5f04a0f7
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    JS File.iniGetObject() and .iniGetAllObjects() now support blank strings

    If an .ini file is read by either the iniGetObject() or iniGetAllObjects() methods and contains a key with a blank value, that property would be created with an "undefined" value.

    Both the iniGetObject() and iniGetAllObjects() methods now accept an additional Boolean argument (which defaults to false), to specify that "blanks" are acceptable. When the "blanks" argument is true, then keys with empty values in the .ini file are created as properties with empty string values (length of 0).

    This is going to be useful for modopts.js to read potentially-blank strings from modopts.ini and differentiate between a blank string key and a missing key.

    ---
    ï¿­ 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 Sep 13 20:08:11 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/105627890fa49ca6a6198408
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Eliminte weird gcc (12.2) warning in release build (only)

    Increasing size of mode[] element by 2 bytes eliminated these GCC warnings
    that seem like false-positives to me:

    sbbs.h:194:48: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    194 | (ret)[JSSTSpos]=(char)JSSTSstrval[JSSTSpos]; \
    | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    js_file.c:225:25: note: in expansion of macro ‘JSSTRING_TO_STRBUF’
    225 | JSSTRING_TO_STRBUF(cx, str, p->mode, sizeof(p->mode), NULL);
    | ^~~~~~~~~~~~~~~~~~
    js_file.c:42:17: note: at offset 5 into destination object ‘mode’ of size 5
    42 | char mode[5];
    | ^~~~

    Similar use of JSSTRING_TO_STRBUF in other files (js_console.cpp, js_archive.c) (with larger target buffers) does not trigger the same warnings.

    ---
    ï¿­ 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 Sat Sep 21 13:08:41 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/6ba59a06b546c1ed0e3b2b8b
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Add missing NULL pointer check to js_iniReadAll()

    iniReadFile() can return NULL upon file read error or malloc error. Let's not crash if that happens.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Tue Oct 1 00:11:39 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/5e1087e457db2b41dab45deb
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    File.read() encodes base64, it doesn't decode.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Sun Jan 26 22:45:40 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/b580def0507913d01bd70cea
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Fix spurious call to JS_THIS_OBJECT()

    This appears to be why valgrind on FreeBSD was failing.
    You can't actually call this in a constructor because creating
    this is the whole point of calling it.

    ---
    ï¿­ 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 10 20:43:13 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/d474410052e6d6022d2b3af4
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Use iniGetSectionList() instead of iniReadSectionList()

    ... in File.iniGetSections() method

    because iniReadSectionList() doesn't recognize !include directives.

    This fixes issue #871 whereby modopts.js couldn't find sections in modopts.d/*.ini files.

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