aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-14win32: Fix process handle vs pid distinctionSteve Bennett4-67/+107
On win32, a process is identified by a HANDLE, but for identifying a running process we should use GetProcessId() to return a meaningful integer. This means we need to be able to back and forth between a pid and a process handle (phandle). We also need to be careful to get the pid before the process handle closes since it isn't available afterwards. Also call the handle to intptr_t for open_osfhandle() to avoid a compiler warning. Fixes #217 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14try: add support for trapSteve Bennett3-47/+132
In addition to "on codes ..." it is now possible to trap on errorcode with "trap sublist ..." e.g. try { ... } trap CHILDSTATUS {msg opts} { ... } Fixes #204 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14build: Respect SH_SOFULLPATHSteve Bennett1-0/+4
Fixes #215 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-12jim-redis: Enable TCP_KEEPALIVESteve Bennett1-0/+2
This is the default already for newer versions of redis. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-12getref, setref: No need to allow for leading, trailing spaceSteve Bennett2-17/+7
There is no reason to allow a reference to contain leading and/or trailing white space, so remove this check and simply treat it as an invalid reference. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-11getref, setref: reference may be qualifiedSteve Bennett2-0/+23
oo.tcl returns globally qualified names like ::<reference.<tree___>.00000000000000000000> So allow getref and setref to handle these qualified references Fixes #218 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-06eventloop: remove timeBaseSteve Bennett1-3/+3
It isn't used (always zero) and isn't needed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05build: Add /usr/lib64 to list of host lib pathsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05build: Use $libdir rather than $prefix/libSteve Bennett2-3/+3
Makes it easier to override Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05aio: read: better handling of -pendingSteve Bennett1-2/+6
Once we determine the number of pending bytes to read, there is no need to read one at a time. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-05aio: ssl: Fix eof detection with openssl3Steve Bennett1-3/+6
Detection of eof takes precedence over detection of error. Fixes #207 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-28sqlite3: Update the included sqlite3 to 3.38.0Steve Bennett5-35080/+79047
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23aio: gets: Improve behaviour for non-blocking streamsSteve Bennett2-17/+75
Previously calling gets on a non-blocking stream could easily result in a partial line. Now if a partial line is read, return zero/empty to indicate that nothing is available while storing the partial line. The next call to gets (typically within a readable script) will continue appending to the previous partial line until a complete line can be returned. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23build: on windows, need --shared for build-jim-ext to workSteve Bennett1-4/+13
So don't build it unless --shared is specified Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23build: Build unversioned shared libSteve Bennett1-2/+5
In order for build-jim-ext to work against an uninstalled, shared libjim we also need to create the unversioned symlink. But not on Windows where we don't currently version the shared lib. Fixes: #216 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-23tests: Fix load.test when jimsh not yet installedSteve Bennett1-19/+17
Needs include, lib paths when jim is not installed Fixes: #216 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-02-22file: delete: Fix --force and --Steve Bennett1-2/+2
The command line processing was wrong such that 'file delete -force abc' would also try to delete files named 'delete' and '-force' in the current directory. If the current directory was writable, this would succeed, but it not writable this would fail and so the desired target was not deleted. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-01-04build: Install unversioned shared libSteve Bennett1-0/+3
Fixes #214 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-16dict: consider dummy entries when determining when to expand hash tableSteve Bennett3-1/+32
This issue was caused by the fix in 24b234543c7322d2dd20339b45367fa3f4c53495 Because we used closed hashing for the dict hash table, it is important that the table doesn't get too full, as it gets very inefficient due to hash collisions. When allowing for space, also consider dummy entries that consume slots. If there are too many dummy slots, the hash table is expanded, clearing out the dummy slots. Without this fix it is possible to get unlucky when filling a dictionary and emptying it again (twice) will result all slots become dummy slots and thus no more entries can be added. See REGTEST 54 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-13examples.api: Remove reference to jim_inlineSteve Bennett2-7/+2
The original jim_hello was a bad example that directly used interpreter data members, so it was removed and jim_inline became jim_hello. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-13dict: Fix possible duplicate entries when settingSteve Bennett2-5/+23
Due to the way hash collisions are managed it is possible to have a sequence where an entry is removed and then another entry is replaced, however the replacement adds an additional entry instead of updating the existing entry. Can be reproduced like this as there is a hash collision between these two keys: dict set d 0,13 X dict set d 8,4 Y dict unset d 0,13 dict set d 8,4 Z Should result in one entry in the dictionary, but instead ends with two. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-13Handle fullwidth charactersPietro Cerutti1-1/+1
2021-12-03Unicode ranges are closed intervalsPietro Cerutti1-2/+2
E.g., see the hourglass character U+231B closing the range at line 1111 of the bundled EastAsianWidth.txt: https://github.com/msteveb/jimtcl/blob/3bf391ebe1a87c1fd0fc064254ef40976dff06f9/EastAsianWidth.txt#L1111
2021-11-28build: update appveyor version numberSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-28Generate shipped documentation for 0.810.81Steve Bennett1-31/+353
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-28bump version to 0.81Steve Bennett2-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-08core: avoid some gcc 11 warningsSteve Bennett1-0/+2
Fixes: #210 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-10-07configure.ac: fix autoreconf with autoconf >= 2.70Fabrice Fontaine1-0/+2
Fix the following build failure raised with openocd and autoconf >= 2.70 due to http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=aba75f6d4a9c875a9d5d90a07c6b3678db66a4bf: >>> openocd 0.11.0 Autoreconfiguring autoreconf: error: configure.ac: AC_INIT not found; not an autoconf script? Fixes: - http://autobuild.buildroot.org/results/5fb7aa28703aff61ba850eac11bd35c8804528ae Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-07-21jim-sqlite3: integers are 64 bit integersSteve Bennett1-1/+1
When extracting the results of a query, an integer result should be retrieved with sqlite3_column_int64(), not sqlite3_column_int() Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-07-15aio: Fix the 'lock' subcommandSteve Bennett1-2/+2
The name of the subcommand was inadvertently "lock ?-wait?" rather than "lock" Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-07-15subcmd: sort subcommand when returning themSteve Bennett1-11/+28
Both for -commands and -help, and when an error is generated, sort the subcommands. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-07-10autosetup: Update .guess and .sub files from '2018-03-08' to '2021-06-03'Veronika Kremneva2-1866/+2210
(This brings autosetup to v0.7.0-7-gc154c58) Signed-off-by: Veronika Kremneva <kremneva@synopsys.com>
2021-07-09tests: move garabage collection test to ref.testSteve Bennett2-17/+24
bootstrap jimsh doesn't have garbage collection, so move such tests into ref.test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-07-08collect: correctly handle references as globally scoped namesSteve Bennett2-3/+28
When a reference is used as a command name (e.g. in oo.tcl) it is created in the global namespace as ::<reference... The current check for references that are commands with a reference count of 1 doesn't take this into account so these references were not being garbage collected. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-07-02exec: support stdin fd being closedSteve Bennett1-3/+3
Don't try to dup2() a file descriptor that is already correct. This can happen if, for example, stdin is closed and exec redirects stdin from a file, thus opening the input as file descriptor 0. Fixes #201 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-04-09build: Allow some paths to contain spacesSteve Bennett5-8/+6
Quote the build dir or and the path to jimsh/tclsh in the Makefile in case they contain spaces. Also fix a few problems in tests/ that arise when the build and/or source dir contain spaces. Fixes #199 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-04-09build: update autosetup for AUTOREMAKE fixSteve Bennett2-6/+6
In case the path to configure contains spaces. v0.7.0-6-g8e7e397 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-04-03expr: allow existing multiple argument support with --compatSteve Bennett3-4/+29
Some users may not be ready to immediately move to the single-argument expr, so provide a --compat option to configure to support the previous behaviour as a transition strategy. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-22json::encode: Improve the implementationSteve Bennett1-69/+62
Use a single subencoder proc for all types. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-19core: Fix memory leak replacing existing commandsSteve Bennett1-3/+11
Fixes #198 Reported-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-10install: Fix install of jimdb for out-of-tree buildSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-10tests: Fix debug.test for single arg exprSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-09expr: TIP 526, only support a single argSteve Bennett8-43/+29
Avoid unexpected issues by concatenating multiple arguments. This does create an incompatibility with early versions, but it is generally trivial to convert existing code to one of two forms: 1. expr {$a + $b} -- usually correct 2. expr "$a + $b" -- usually incorrect Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-07aio: pass socktype to getaddrinfo()prpr19xx1-8/+10
Some old systems are not happy with a numeric service and no socktype. Fixes #196 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27aio: tests: bootstrap jimsh doesn't have posix open flagsSteve Bennett1-5/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27tests: Fix return code from tests/runall.tclSteve Bennett1-2/+2
In the case where interp is not supported Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27aio: mingw doesn't have O_NOCTTYSteve Bennett1-0/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27docs: Clarify that regexp back references are not supportedSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27aio: open: support for POSIX open flagsSteve Bennett3-3/+112
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-20aio: rework internals of openSteve Bennett1-25/+27
In preparation for support of posix mode flags to open Signed-off-by: Steve Bennett <steveb@workware.net.au>