• src/sbbs3/js_file.c

    From rswindell@VERT to CVS commit on Monday, April 02, 2018 22:37:00
    src/sbbs3 js_file.c 1.170 1.171
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv11679

    Modified Files:
    js_file.c
    Log Message:
    The 'e' (exclusive-open) mode flag (introduced in v3.12) never worked. It was simply ignored when converted to the underlying open mode passed to sopen(). Deprecate this flag and log a warning when it is detected as used in a script: Deprecated open flag used: 'e'
    Added 'x' (exclsuive-open) mode flag which:
    1. was tested to work as intended
    2. is consistent with the C11 standard for fopen() mode flags
    3. won't cause existing scripts to suddenly break


    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, April 02, 2018 23:22:00
    src/sbbs3 js_file.c 1.171 1.172
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv14685

    Modified Files:
    js_file.c
    Log Message:
    Updated JS warning when using old/deprecated file open mode 'e':
    "Deprecated file open mode: 'e'"
    If this is your script generating this warning, either remove the 'e' from
    the File open() mode string (it had no effect anyway) or change to 'x' to
    get the real/working exclusive-open functionality (added in v3.17).



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, August 28, 2018 21:47:00
    src/sbbs3 js_file.c 1.172 1.173
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv16344

    Modified Files:
    js_file.c
    Log Message:
    New File properties to change .ini file style attributes:
    - ini_key_len
    - ini_key_prefix
    - ini_section_separator
    - ini_value_separator
    - ini_bit_separator
    - ini_literal_separator



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, August 28, 2018 22:47:00
    src/sbbs3 js_file.c 1.173 1.174
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_file.c
    Log Message:
    Fix a number of problems in the previous commit (ini styles).
    Also, the File() constructor will now properly complain if no filename
    is passed.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, January 09, 2019 10:54:00
    src/sbbs3 js_file.c 1.174 1.175
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv20725

    Modified Files:
    js_file.c
    Log Message:
    Updated JSDOCS descriptions of File.ini methods.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, January 10, 2019 11:51:00
    src/sbbs3 js_file.c 1.175 1.176
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/jsdocs/src/sbbs3

    Modified Files:
    js_file.c
    Log Message:
    Fix JSDOCS_BUILD issue introduced in previous commit.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Monday, July 15, 2019 03:35:45
    src/sbbs3 js_file.c 1.180 1.181
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv2257

    Modified Files:
    js_file.c
    Log Message:
    Fix long-standing issue with File.attributes on Windows: the value *read*
    was based on _finddata_t.attrib value while the value *written* was based on struct stat.st_mode, and totally incompatible.
    Just use the stat/chmod compatible value for both read and write (for all OSes). If you need the old Windows-centric attribute values (e.g. to determine "hidden" or "archive" attributes), use file_attrib() instead.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, July 18, 2019 03:14:48
    src/sbbs3 js_file.c 1.181 1.182
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv18853

    Modified Files:
    js_file.c
    Log Message:
    Bug in JSDOCS: File.iniSetAllObjects returns a Boolean, not an Array.


    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, August 15, 2019 18:34:04
    src/sbbs3 js_file.c 1.182 1.183
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv6042

    Modified Files:
    js_file.c
    Log Message:
    Fix "off-by-one" error in File.readln() and readAll() with regards to the 'maxlen' argument. E.g. passing 10 would result in a maximum read string length of 9 characters.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, August 21, 2019 02:28:01
    src/sbbs3 js_file.c 1.183 1.184
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv21798

    Modified Files:
    js_file.c
    Log Message:
    Fix potential double-close() call in File.open() method implementation:
    if fdopen() failed, we'd close the file descriptor but leave it dangling with
    a >= 0 value and then call close() again on it later in the function.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, August 21, 2019 18:32:34
    src/sbbs3 js_file.c 1.184 1.185
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv20572

    Modified Files:
    js_file.c
    Log Message:
    Report a JS warning, with details, when fdopen() fails.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Tuesday, August 27, 2019 16:47:58
    src/sbbs3 js_file.c 1.185 1.186
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv11820

    Modified Files:
    js_file.c
    Log Message:
    Actually honour File.network_byte_order.




    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, September 19, 2019 06:03:53
    src/sbbs3 js_file.c 1.186 1.187
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv17577

    Modified Files:
    js_file.c
    Log Message:
    Address some debug-log output issues with the File object:
    "4294967295 File closed"
    "0000 File closed: /path/to/file"



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thursday, September 19, 2019 06:49:02
    src/sbbs3 js_file.c 1.187 1.188
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv27489

    Modified Files:
    js_file.c
    Log Message:
    Don't leak FILE streams for calls to js_CreateFileObject(), setting external
    to TRUE meant the FILE* (created with fdopen) would never be closed. So we now duplicate the file descriptor and get rid of the external flag, always closing Files (FILE streams) upon File object finalize.
    This fixes the resource leak leading to the eventual "Error 24 opening ..." in the ircd.js when loaded via jsexec, on Windows. This error happened after
    169 calls to load(true,...), because each background load creates 3 Files
    (for stdin/out/err) and those FILE streams were never closed/freed, and
    169 * 3 = 507, plus a few open files = 512, the maximum number of open file streams in the Microsoft CRTL apparently. Thanks to Deuce for recognizing these numbers as "magic" and pointing to the likely cause.



    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Thursday, September 19, 2019 06:54:49
    src/sbbs3 js_file.c 1.188 1.189
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv29285

    Modified Files:
    js_file.c
    Log Message:
    Even more leak paranoia...
    If dup() fails, return NULL
    If callog() fails, fclose() the new FILE*
    No functional change (hopefully).




    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Friday, November 13, 2020 21:55:10
    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@VERT to Git commit to main/sbbs/master on Sunday, January 03, 2021 22:16:24
    https://gitlab.synchro.net/main/sbbs/-/commit/3005a5a93e57cd0f9250c319
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Fix File.crc32 property value on 64-bit systems (ulong is > 32-bits)

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sunday, January 24, 2021 21:52:29
    https://gitlab.synchro.net/main/sbbs/-/commit/8fdbb1692b8ad6c1959f8f3e
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    More support for !include in .ini files

    Some (important) File methods did not support .ini files that used the !include directive because they were using the xpdev iniRead* API (which performs no "pre-processing") instead of xpdev iniGet*.

    Impacted methods:
    - iniGetValue()
    - iniGetKeys()
    - iniGetObject()

    The other existing ini* methods already worked fine with nested (!include'd) .ini files. It's possible there's a slight performance penalty with the new implementation since the entire .ini file is always read for each operation and previously it was possible that only a few "lines" were read to find the key(s) of interest. However, since .ini files are not typically huge and the iniRead/file-stream method likely read large (e.g. 8-32K) blocks anyway (which is usually the entire .ini file) - I don't actually suspect any observable impact to performance.

    This change was needed for the new ctrl/modopts.d support.

    Added new method useful for debugging nested .ini files:
    - iniReadAll()

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From Deuce@VERT to Git commit to main/sbbs/master on Tuesday, January 26, 2021 01:05:31
    https://gitlab.synchro.net/main/sbbs/-/commit/fb00000af4c304a5d3118bd3
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Don't throw an exception when setting or getting class properties.

    Doing so prevents extending the prototype.

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From Deuce@VERT to Git commit to main/sbbs/master on Tuesday, January 26, 2021 18:19:30
    https://gitlab.synchro.net/main/sbbs/-/commit/24a9a7d9215fe80ee6b766ee
    Modified Files:
    src/sbbs3/js_file.c
    Log Message:
    Fix error in previous commit that switch to GetInstancePrivate()

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