aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-08-28jim.c: Only a return code of -1 (JIM_USAGE) produces usage errorHEADmasterSteve Bennett1-1/+1
Previously any negative value would produce a usage message but this can affect some code that uses negative return codes for its own purpose. Fixes: #356 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-20exec: Fix compilation error in fall-back implementationSteve Bennett1-1/+1
Fix some code that wasn't updated in the move to Jim_RegisterCommand() Fixes: #355 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13tclcompat: allow additional args to parraySteve Bennett1-2/+4
Rather than: parray env * [curry stderr puts] it is now easier to write: parray env * stderr puts Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13make-bootstrap-jim, test-bootstrap-jim: support --no-regexpSteve Bennett2-4/+24
To build without the jim builtin regex Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13tests: regexp: mark some tests as requiring ARESteve Bennett1-23/+23
This means jim builtin regex, not posix regex Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13tests: interactive.test: fix for posix regexSteve Bennett1-18/+18
If using POSIX regex instead of the builtin jim regex, \r and \n character escapes are not supported. Use literal \r and \n instead. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13jim-regexp.c: clean up some inconsistent whitespaceSteve Bennett1-5/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13regexp, regsub: add support for -lineanchor and -linestopSteve Bennett5-77/+97
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13regexp, regsub: sort -- after all other optionsSteve Bennett3-4/+18
This matches Tcl 9.0 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13regexp, regsub: usage closer to Tcl 9.0Steve Bennett3-27/+37
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-08-13regsub -all: don't loop forever when matching everywhereSteve Bennett3-16/+35
Although "" and "x*" both match the empty string, the former correctly exits, while the latter looped forever. Match Tcl here by advancing by one char in both cases, but in the latter case end of string is matched, while in the former it is not. Also prevent both cases from slicing a utf-8 char into bytes. Fixes: #353 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16docs: document subst with $(...)Steve Bennett1-0/+3
Fixes: #318 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: Jim_SetVariable() now frees value on errorSteve Bennett7-44/+31
If the value has a zero reference count, free it in the error path. Otherwise callers can't do: Jim_SetVariable(..., Jim_New...()) in case the object is leaked in the error path. Fix various callers that were previously freeing the object in the error path, and add a test to loop.test to show that this was not. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16codeql: fix fail_on_error.pySteve Bennett1-1/+4
The format of the output seems to have changed slightly Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16codeql: maybe needs on push [ "master" ]Steve Bennett1-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16update codeql actions to use v3Steve Bennett1-4/+4
Just blindly changing v2 to v3. No idea if this is correct. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16configure --compat should enable expr with multiple argsSteve Bennett1-8/+8
Not disable it. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16docs: Update shipped documentationSteve Bennett1-195/+494
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16regexp: Handle non repeat count {...}Steve Bennett2-17/+43
If it does not contain a number, treat it as an exact match. Fixes #323 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16Add os.umaskSteve Bennett2-2/+28
Fixes #278 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16Update tests for new vwait with scriptSteve Bennett1-4/+23
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16document vwait scriptSteve Bennett1-3/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16eventloop: Add support for vwait scriptSteve Bennett1-5/+22
An additional arg to vwait is now supported: vwait ?-signal? var ?script? If the script is given it is evaluated on every event. If the script returns a break or error code, the vwait terminates. This approach makes it easier to avoid using global variables to control the eventloop. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16regexp: assign match vars with -allSteve Bennett2-7/+12
To match the documentation and Tcl, if match vars are given with -all, the last match is assigned. Fixes #310 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16info patchlevel: now returns git version if availableSteve Bennett3-7/+21
e.g. . info patchlevel 0.83-35-g8a438c3-dirty Fixes #297 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16regexp, regsub: add support for -expandedSteve Bennett6-21/+94
Fixes #311 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16docs: document expr =* and =~Steve Bennett1-0/+9
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16expr: add support for =* and =~Steve Bennett3-5/+68
glob match and regexp match operators Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16add lsubst commandSteve Bennett3-2/+328
Halfway between list and subst, makes it easy to construct lists with substitutions (as opposed to strings with substitutions) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16github workflow: build master-nextSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16docs: update for 'info usage' and 'info aliases'Steve Bennett1-9/+19
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16info: procs, commands, don't returns commands with spacesSteve Bennett4-25/+40
We implement ensembles by creating commands with spaces, like {tree children}. This can clutter the commands returned by 'info procs', 'info commands'. So don't return these by default. Add the '-all' option return all commands. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16Update examples.api and examples.ext to use Jim_RegisterCommandSteve Bennett3-18/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16sqlite3: Update to use new Jim_RegisterCmdSteve Bennett1-23/+22
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: Add Jim_RegisterCommand()Steve Bennett39-871/+655
and wrappers Jim_RegisterCmd, Jim_RegisterSimpleCmd and Jim_RegisterSubCmd Allows usage, help and flags when registering commands. Allows for JIM_CMD_ISPROC, JIM_CMD_ISALIAS, JIM_CMD_ISCHANNEL 'info usage' and (later) 'info help' Now every command doesn't need to check min/max and print usage. This also adds support for 'info aliases', 'info channels' and 'exists -channel'. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16jim_tcl.txt: Document taint supportSteve Bennett1-0/+25
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: set -errorcode to TAINTED on taint errorSteve Bennett2-0/+9
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16redis: check redis command for taintSteve Bennett1-1/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16win32: add taint check to win32.ShellExecuteSteve Bennett1-0/+4
Compile tested only. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16README.taintSteve Bennett1-17/+17
Incorporate edit suggestions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16jim-sqlite3: Add taint supportSteve Bennett1-0/+11
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: taint supportSteve Bennett17-41/+798
See README.taint Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16Jim_EvalFile: accept input from any readable fileSteve Bennett1-33/+20
It is no longer necessary to stat the file and read it all at once. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16docs: Update docs for new TIP424 exec syntaxSteve Bennett1-16/+31
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16tests: add tests for TIP424 exec syntaxSteve Bennett1-0/+424
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16exec: Implement TIP424 - new exec syntaxSteve Bennett2-5/+77
exec | {cmdlist ...} ?redir? ... This is a safer form of exec in that redirection meta characters are no longer searched in cmdlist Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16exec: rework in prep for TIP 424Steve Bennett2-184/+277
Split out JimExecPipeline() in such a way that it will be possible to reuse this for TIP424 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: improve the Jim_Stack APISteve Bennett3-50/+33
Now the optional free element function is passed on init and is automatically used to free elements on free. Naming is also now consistent as Jim_Stack* Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-16core: remove unused fields and bump ABISteve Bennett2-11/+6
Now various fields in Jim_Interp and Jim_CallFrame are unused so remove them and bump the ABI version to prevent loading of incompatible extensions. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2025-07-09Add more build generated files to .gitignoreprpr19xx1-0/+2