aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-06-02jim-sqlite3: Fix error msg for 'query'Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-30expr: Ensure that non-zero return codes are passed throughSteve Bennett2-28/+44
Non-zero return codes (e.g. break, continue, exit) were all being converted to the error code. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-26format: validate too long precisionSteve Bennett2-1/+6
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-26scan: validate -ve XPG3 specifierSteve Bennett2-0/+10
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-23expr: Replace expression engineSteve Bennett4-933/+611
Rework the expression engine to use recursive descent evaluation rather than a shunting yard algorithm. Among other things, it is easier to make lazy operators and the ternary operator work correctly. In particular, the following expression no longer crashes: $(99?9,99?9:*9:999)?9) And the code is now smaller. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-23optimisation: when converting to double, may not need stringrepSteve Bennett1-6/+5
Minor optimisation Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-23optimisation: Reuse ExprBool in Jim_GetBoolFromExpr()Steve Bennett1-26/+15
Removes some duplicate code Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12scan: Ensure format is converted to string formSteve Bennett2-2/+7
Must have a stringrep before parsing. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12regexp: Fix bad memory access on missing close braceSteve Bennett2-0/+9
For counted repetitions Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12lsort -unique: Fix case with no duplicatesSteve Bennett2-2/+11
In this case the final element was written a second time. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12format: Restrict formatted fields to a reasonable sizeSteve Bennett1-0/+7
Calling the system sprintf() with overly long sizes can cause problems, so limit field size to 10000. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12format: Validate too many flags in format stringSteve Bennett2-1/+7
Avoid a stack overflow Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12exec: Fix check for | and |&Steve Bennett2-4/+10
These are only allowed as separate args. One check was allowing them as a prefix which could lead to an invalid memory access Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12scan: error on missing conversion charSteve Bennett2-1/+11
Don't read invalid memory Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12exec: Validate that a command is givenSteve Bennett1-0/+6
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12jim: Fix ref count problem with interpolated dict substSteve Bennett2-17/+18
When duplicating interpolated object type, need to increment ref count of the key to offset the decrement during free. Also remove type-specific dup for dict-substitution which is not needed since it does nothing different from the default dup. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12lsort: Fix a refcount issueSteve Bennett2-2/+11
Only duplicate a shared object Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-22build: Update autosetup to v0.6.6-8-g062d650Steve Bennett16-2323/+2670
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-21configure: fix --docdir optionSteve Bennett1-1/+1
opt-val now returns a list, so take the last option given Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-20aio: Only allow TCP_NODELAY if sockets are supportedSteve Bennett1-2/+2
Sockets need extra work on Windows, so not supported there yet. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-20aio: Add support for TCP_NODELAYSteve Bennett2-0/+29
Enable or disable Nagle's algorigthm Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-20zlib: compression may need some additional free spaceSteve Bennett1-0/+6
Signed-off-by: Stuart Cassoff <stwo@bell.net>
2017-04-19zlib: deflate: free correct pointer on errorSteve Bennett1-2/+2
Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Fix clock format on mingw platformsSteve Bennett2-6/+8
gmtime() fails for negative time_t values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Fix test for platforms with no scan supportSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Add -gmt option to format and scanSteve Bennett3-36/+162
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-08jimsh: Fix crash with "throw 8"Steve Bennett1-1/+1
Off by one for length of the return code name array. Found with afl-fuzz. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07expr: Add better checks for invalid ternary expressionSteve Bennett3-6/+19
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07expr: Add assertion for stack underflowSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07Fix ref count for interpolation/expressionSteve Bennett2-1/+8
Ref count may be wrong when an expression is used in interpolation. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07expr: fix crash on invalid ternary orderSteve Bennett2-1/+10
expr {1 : 2 ? 3} Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07Fix / command: divide by zeroSteve Bennett2-1/+11
Avoid exception on integer divided by zero Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-03-16linenoise.c: Use <poll.h> instead of <sys/poll.h>Steve Bennett1-1/+1
Update to match linenoise.git Signed-off-by: Steve Bennett <steveb@workware.net.au> diff --git a/linenoise.c b/linenoise.c index 091d197..171dcef 100644 --- a/linenoise.c +++ b/linenoise.c @@ -116,7 +116,7 @@ #else #include <termios.h> #include <sys/ioctl.h> -#include <sys/poll.h> +#include <poll.h> #define USE_TERMIOS #define HAVE_UNISTD_H #endif Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-03-11Fix buffer overrun in utf8_index()HummyPkg1-1/+1
2017-03-03Fix some declarations after codeSteve Bennett3-5/+7
For the benefit of C89 compilers. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-02-13aio: Fix stdio error detectionSteve Bennett1-1/+1
The test for ECONNABORTED was reversed such that errors such as ENXIO did not correctly return an error. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-11-19build: remove jimtcl.pc on distcleanSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-11-14dict: Fix [dict values] with duplicate valuesSteve Bennett5-48/+38
The script implementation of dict values was not correctly handling the case where a dictionary had duplicate values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-26build: update autosetup for LIBS/LDFLAGS fixSteve Bennett1-4/+9
343be844 cc tests should use LIBS and LDFLAGS Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-26build: On NetBSD backtrace is in -lexecinfoSteve Bennett1-1/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-26examples/tip.tcl: Gracefully handle serial port being removedSteve Bennett1-2/+9
e.g. a usb-serial port Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-19examples/tip.tcl: Lock the deviceSteve Bennett1-0/+5
Prevent multiple access to a serial port by using locking. This is probably compatible with most serial port locking on Linux. Perhaps on macosx. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-18aio tty: clear ICRNL for raw input modeSteve Bennett1-0/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-17Add pkg-config support: jimtcl.pcSteve Bennett4-1/+21
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-14build: update autosetup for Tcl 8.5 compatibilitySteve Bennett1-20/+16
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-13Fix distclean of jimsh0 when building not in source dirEvan Hunter1-1/+1
2016-10-12signal: restore default signal handlingSteve Bennett1-1/+20
If the interpreter or signal command is deleted, restore default signal handling and free allocated memory. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-12Array fixes and testsEvan Hunter4-15/+84
Changed 'array exists' to actually check if the variable is an array (matches tclsh) Fix Jim_DictInfo to avoid using printf() and make output match tclsh Added some more tests for array command - checked these work with tclsh
2016-10-11Fix warnings when building win32 module and add module to appveyor buildEvan Hunter2-4/+4
2016-10-11build: remove -Werror when running ./configureSteve Bennett1-0/+6
Building with CFLAGS="-Werror -Wall" caused configure to fail due to the following warnings being converted to errors: * conflicting types for built-in function * unused variable When these warnings get converted to errors, they prevent the detection of fork, isascii, isinf, isnan, math libs, long long & struct flock. Add -Wno-error in this case to prevent these warnings being treated as errors. Reported-by: Evan Hunter <evan@ozhiker.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>