Ben Pfaff [Fri, 12 Nov 2021 03:50:45 +0000 (19:50 -0800)]
fix up test output
Ben Pfaff [Fri, 12 Nov 2021 03:48:36 +0000 (19:48 -0800)]
more improvement
Ben Pfaff [Fri, 12 Nov 2021 03:46:02 +0000 (19:46 -0800)]
Improve MGET output table.
Ben Pfaff [Fri, 12 Nov 2021 03:27:50 +0000 (19:27 -0800)]
Basic MGET tests work.
Ben Pfaff [Tue, 9 Nov 2021 06:55:13 +0000 (22:55 -0800)]
More MATRIX SAVE negative tests.
Ben Pfaff [Mon, 8 Nov 2021 19:37:02 +0000 (11:37 -0800)]
MATRIX SAVE negative tests
Ben Pfaff [Mon, 8 Nov 2021 01:47:14 +0000 (17:47 -0800)]
MATRIX SAVE inline positive tests.
Ben Pfaff [Mon, 8 Nov 2021 01:27:19 +0000 (17:27 -0800)]
MATRIX SAVE positive tests.
Ben Pfaff [Sun, 7 Nov 2021 19:17:46 +0000 (11:17 -0800)]
GET is well tested.
Ben Pfaff [Sun, 7 Nov 2021 03:40:42 +0000 (20:40 -0700)]
MATRIX GET works with the active file.
Ben Pfaff [Sun, 7 Nov 2021 03:09:24 +0000 (20:09 -0700)]
MATRIX GET positive test
Ben Pfaff [Sun, 7 Nov 2021 02:38:19 +0000 (19:38 -0700)]
READ and WRITE are tested.
Ben Pfaff [Sat, 6 Nov 2021 21:15:29 +0000 (14:15 -0700)]
format: Make fmt_check() easier to translate.
Ben Pfaff [Sat, 6 Nov 2021 18:56:20 +0000 (11:56 -0700)]
Test REREAD also.
Ben Pfaff [Sat, 6 Nov 2021 18:52:27 +0000 (11:52 -0700)]
More READ negative tests.
Ben Pfaff [Sat, 6 Nov 2021 18:42:26 +0000 (11:42 -0700)]
READ negative tests
Ben Pfaff [Sat, 6 Nov 2021 18:30:15 +0000 (11:30 -0700)]
Make tests pass again.
Ben Pfaff [Sat, 6 Nov 2021 05:58:13 +0000 (22:58 -0700)]
matrix docs
Ben Pfaff [Sat, 6 Nov 2021 05:58:07 +0000 (22:58 -0700)]
MATRIX: Implement HOLD (untested).
Ben Pfaff [Sat, 6 Nov 2021 05:40:28 +0000 (22:40 -0700)]
MATRIX: Factor out write_file, like read_file.
Ben Pfaff [Sat, 6 Nov 2021 02:59:59 +0000 (19:59 -0700)]
MATRIX: Fix leak on error path.
Ben Pfaff [Mon, 25 Oct 2021 16:57:08 +0000 (09:57 -0700)]
Add an example for MATRIX PRINT.
Ben Pfaff [Mon, 25 Oct 2021 04:37:06 +0000 (21:37 -0700)]
More matrix examples.
Ben Pfaff [Mon, 25 Oct 2021 01:28:30 +0000 (18:28 -0700)]
work on examples
Ben Pfaff [Sun, 24 Oct 2021 23:40:04 +0000 (16:40 -0700)]
MATRIX command documentation is complete (but needs examples)
Ben Pfaff [Tue, 12 Oct 2021 06:03:06 +0000 (23:03 -0700)]
Document more matrix stuff.
Ben Pfaff [Sat, 9 Oct 2021 23:10:21 +0000 (16:10 -0700)]
documentation
Ben Pfaff [Sat, 9 Oct 2021 21:56:18 +0000 (14:56 -0700)]
Improve matrix error messages.
Ben Pfaff [Sat, 9 Oct 2021 20:08:24 +0000 (13:08 -0700)]
MATRIX: Fix memory leaks.
Ben Pfaff [Sat, 9 Oct 2021 06:19:37 +0000 (23:19 -0700)]
Work on documentation
Ben Pfaff [Fri, 8 Oct 2021 05:52:54 +0000 (22:52 -0700)]
docs
Ben Pfaff [Thu, 7 Oct 2021 21:11:23 +0000 (14:11 -0700)]
function documentation
Ben Pfaff [Thu, 7 Oct 2021 05:43:41 +0000 (22:43 -0700)]
work on docs
Ben Pfaff [Mon, 27 Sep 2021 05:35:44 +0000 (22:35 -0700)]
MATRIX
Ben Pfaff [Sat, 9 Oct 2021 17:20:28 +0000 (10:20 -0700)]
dataset: Fix memory leak destroying a dataset that has a permanent_dict.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 17:13:34 +0000 (10:13 -0700)]
pivot-table-test: Fix memory leak when table is not displayed.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 17:10:35 +0000 (10:10 -0700)]
lexer: Fix memory leak merging tokens only some of which come from macros.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 16:41:01 +0000 (09:41 -0700)]
macro: Fix memory leaks in error cases parsing function arguments.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 16:35:41 +0000 (09:35 -0700)]
lexer: Fix memory leak when macro expands as empty.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 16:32:02 +0000 (09:32 -0700)]
macro: Fix memory leak expanding !DO loop over list.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 16:23:52 +0000 (09:23 -0700)]
macro: Fix memory leak with keyword "enclose" arguments.
The memory for the argument was being allocated two places, which caused
the first-allocated block to be leaked.
Found by Address Sanitizer.
Ben Pfaff [Sat, 9 Oct 2021 16:13:40 +0000 (09:13 -0700)]
segment: Fix read past end of buffer when input ends in '-'.
Thanks to John Darrington for reporting this.
Found by Address Sanitizer.
Ben Pfaff [Wed, 6 Oct 2021 05:15:28 +0000 (22:15 -0700)]
expressions: Parse multiple sets of parentheses for grouping together.
Fuzzers are fond of driving expression parsers to failure by exhausting
the stack in trivial ways. This defeats the simplest attempts by
lining up thousands of left parentheses in a row.
I am a bit curious whether the fuzzer will now invent something more
sophisticated, such as nested function calls or non-empty expressions like
1+(1+(1+(1+(1+....
This fixes bug #61286.
Thanks to Irfan Ariq for reporting the bug.
Ben Pfaff [Wed, 6 Oct 2021 04:57:37 +0000 (21:57 -0700)]
DATA LIST: Fix assertion when RECORDS given twice with decreasing value.
Fixes bug #61285.
Thanks to Irfan Ariq for reporting this bug.
Ben Pfaff [Tue, 5 Oct 2021 16:19:26 +0000 (09:19 -0700)]
dictionary: Allow dict_set_documents() argument to reference old documents.
merge_dictionary() in combine-file.c includes the old documents in the new
ones by just copying pointers. dict_set_documents() didn't handle this
properly. This fixes the problem.
Fixes bug #61258.
Thanks to Irfan Ariq for reporting the problem.
Ben Pfaff [Tue, 5 Oct 2021 15:47:46 +0000 (08:47 -0700)]
encoding-guesser: Avoid reading uninitialized data for zero-length files.
Found while investigating bug #61254.
Thanks to Irfan Ariq for reporting this bug.
Ben Pfaff [Tue, 5 Oct 2021 06:14:32 +0000 (23:14 -0700)]
segment: Fix 1-byte read past initialized data when file ends in CR.
Fixes bug #61253.
Thanks to Irfan Ariq for reporting this bug.
John Darrington [Sun, 3 Oct 2021 06:03:44 +0000 (08:03 +0200)]
Remove some unnecessary gettext macro definitions
John Darrington [Sat, 2 Oct 2021 19:16:55 +0000 (21:16 +0200)]
Fix compiler warning
John Darrington [Sat, 2 Oct 2021 16:33:21 +0000 (18:33 +0200)]
Fix memory leak in tokenize_string_segment
John Darrington [Sat, 2 Oct 2021 14:51:37 +0000 (16:51 +0200)]
Fix memory leak in MCONVERT
John Darrington [Sat, 2 Oct 2021 14:35:42 +0000 (16:35 +0200)]
Fix memory leak upon failure to create matrix reader
John Darrington [Sat, 2 Oct 2021 14:31:14 +0000 (16:31 +0200)]
More ASAN_OPTIONS
John Darrington [Sat, 2 Oct 2021 13:32:40 +0000 (15:32 +0200)]
Use XCALLOC / XZALLOC macros where reasonable
John Darrington [Sat, 2 Oct 2021 04:48:57 +0000 (06:48 +0200)]
Fix possible segfault when running RANK with bad syntax
* src/language/stats/rank.c (): Initialise the vars member
Fixes bug #61257
John Darrington [Sat, 2 Oct 2021 04:47:31 +0000 (06:47 +0200)]
Replace numerous instances of xzalloc with XZALLOC
John Darrington [Sun, 26 Sep 2021 18:26:45 +0000 (20:26 +0200)]
Matrix readers - fix memory leaks
* src/language/data-io/matrix-reader.c (matrix_reader_destroy): free members cvar, svars and fvars
John Darrington [Sun, 26 Sep 2021 18:39:38 +0000 (20:39 +0200)]
Ignore sanitizer ODR warnings, during testing with -fsanitize=address
* tests/libpspp/sparse-xarray-test.at: Set detect_odr_violation=0
Ben Pfaff [Mon, 27 Sep 2021 05:35:33 +0000 (22:35 -0700)]
Implement the MCONVERT command.
Ben Pfaff [Sun, 26 Sep 2021 18:06:45 +0000 (11:06 -0700)]
lexer: Fix use-after-free error in lex_source_get_lookahead().
This code used local variable 'out' as if its value stayed the same from
one iteration of the loop to the next, but in fact its scope meant that
it became indeterminate on each new iteration. This commit fixes the
problem by moving its declaration to an outer scope.
Thanks to John Darrington for reporting the problem.
John Darrington [Sun, 26 Sep 2021 14:53:38 +0000 (16:53 +0200)]
Avoid numerical problems with missing weights on non-linear cases.
* src/math/order-stats.c (order_stats_accumulate_idx): Ignore cases
with missing weight values.
John Darrington [Sat, 25 Sep 2021 16:59:52 +0000 (18:59 +0200)]
Fix possible incorrect assertion when creating unique casereaders.
* src/data/casereader-translator.c (uniquify): Force dir to be an element of {0, 1, -1}
John Darrington [Sat, 25 Sep 2021 09:41:04 +0000 (11:41 +0200)]
Remove unused module src/math/extrema
* src/math/extrema.c: Delete
* src/math/extrema.h: Delete
* src/math/automake.mk: Remove entries for src/math/extrema.c and
src/math/extrema.h
John Darrington [Sat, 11 Sep 2021 05:39:29 +0000 (07:39 +0200)]
Options dialog: add checkbox for startup tips
Ben Pfaff [Mon, 6 Sep 2021 17:07:41 +0000 (10:07 -0700)]
sys-file-encoding: Automatically generate the .c file at build time.
Suggested by John Darrington.
John Darrington [Sun, 5 Sep 2021 11:16:33 +0000 (13:16 +0200)]
Windows/build-dependencies: Add -fstack-protector flags
For some reason this flag seems to be necessary with the latest
x86_64_w64-mingw32 toolchain.
John Darrington [Sun, 5 Sep 2021 11:01:25 +0000 (13:01 +0200)]
Windows/build-dependencies: Use correct logical OR operator
John Darrington [Sun, 5 Sep 2021 10:59:49 +0000 (12:59 +0200)]
Windows/build-dependencies: New flag --no-clean
John Darrington [Sat, 4 Sep 2021 07:36:55 +0000 (09:36 +0200)]
Add some missing #include directives
* src/language/stats/crosstabs.c: Add missing #include directive.
* src/libpspp/pool.c: Add missing #include directive.
Ben Pfaff [Fri, 3 Sep 2021 05:15:53 +0000 (22:15 -0700)]
MATRIX DATA: Fully implement.
This command had a partial implementation for correlation matrices that
left out some of the language features. This commit adds those features.
Ben Pfaff [Fri, 3 Sep 2021 02:59:23 +0000 (19:59 -0700)]
case: Introduce new functions for numbers and substrings in cases.
Use the case_num_*() functions everywhere in the tree for clarity and
brevity.
Ben Pfaff [Fri, 3 Sep 2021 01:45:39 +0000 (18:45 -0700)]
sys-file-encoding: Put the buffer-read-only declaration at the very top.
This accidentally got pushed down when license notices were added to a
bunch of files en masse. It only works if it's at the top.
Ben Pfaff [Sat, 31 Jul 2021 02:48:08 +0000 (19:48 -0700)]
Remove unneeded Emacs declarations that say that a .c file is in C.
These were there because they were formerly .q files.
Ben Pfaff [Thu, 2 Sep 2021 16:23:11 +0000 (09:23 -0700)]
DEFINE: Properly support redefining a macro.
Redefining a macro didn't work in simple cases because the macro name was
being expanded in the DEFINE command.
Thanks to Frans Houweling for reporting the bug.
Ben Pfaff [Wed, 1 Sep 2021 17:02:26 +0000 (10:02 -0700)]
macro: Fix crash for !QUOTE of a quoted string.
This revealed that the tests didn't include anything for !QUOTE and
!UNQUOTE, even though the manual had lots of examples. I added a test for
these and for !NULL, which had also been forgotten.
Thanks to Frans Houweling for reporting the bug.
John Darrington [Sun, 29 Aug 2021 17:45:38 +0000 (19:45 +0200)]
Avoid GtkCritical on startup
John Darrington [Sat, 28 Aug 2021 08:50:32 +0000 (10:50 +0200)]
TeX tests: Use the shell instead of wc to test for maximum line length.
When testing for maximum line length use the shell rather than
relying on wc -L : The -L flag is not present on some systems.
tests/tex.at: Remove dependence on wc
configure.ac: Remove test for wc -L
Fixes bug #59859
John Darrington [Sat, 28 Aug 2021 07:10:34 +0000 (09:10 +0200)]
Fix import of ods files with repeated column data.
Fixes bug #61078
Reported-by: Elias Tsolis
John Darrington [Sat, 28 Aug 2021 07:02:14 +0000 (09:02 +0200)]
Fix crash when double clicking on variable sheet cells when no variable is defined.
Reported-by: Maruthi Pathapati
Ben Pfaff [Thu, 26 Aug 2021 16:32:31 +0000 (09:32 -0700)]
DEFINE: Only expand macro functions when the name is followed by '('.
Frans Houweling reported that PSPP was flagging an error for !EVAL(!len)
when !len was the name of a defined macro. This was because !len is short
for the !LENGTH macro function. This commit fixes the problem.
John Darrington [Sat, 24 Jul 2021 13:32:04 +0000 (15:32 +0200)]
Tolerate pathnames with spaces
Reported by: Vivien Kraus
Ben Pfaff [Sat, 24 Jul 2021 06:17:48 +0000 (23:17 -0700)]
macro: Continue expanding macro even in face of errors in call.
In practice, it was more confusing not to expand it than to expand it.
Ben Pfaff [Sat, 24 Jul 2021 06:08:31 +0000 (23:08 -0700)]
macro: Allow positional arguments to be empty.
It wasn't clear before that this was allowed, but it seems that it should
be for compatibility.
Reported by Frans Houweling.
Ben Pfaff [Sat, 24 Jul 2021 05:50:55 +0000 (22:50 -0700)]
macro: Make ARG_CHAREND and ARG_ENCLOSE more uniform in struct macro_param.
A few pieces of code want to find the end of a parameter and it's easier
if the "end" token is always the same member.
Ben Pfaff [Sat, 24 Jul 2021 05:51:34 +0000 (22:51 -0700)]
identifier: Make T_STOP always 0.
This is more sensible default if a token is zero-initialized.
Ben Pfaff [Thu, 22 Jul 2021 06:00:10 +0000 (23:00 -0700)]
macro: Allow macro A to use its arguments as part of call to macro B.
I overlooked this possibility before. This implements it.
Thanks to Frans Houweling for reporting the issue.
Ben Pfaff [Thu, 22 Jul 2021 05:48:07 +0000 (22:48 -0700)]
Turn !* into a single token, for macro expansion purposes.
Ben Pfaff [Tue, 20 Jul 2021 14:53:59 +0000 (07:53 -0700)]
DEFINE: Equals sign is optional for both positional and keyword parameters.
Thanks to Frans Houweling for reporting this bug.
Ben Pfaff [Tue, 20 Jul 2021 05:19:41 +0000 (22:19 -0700)]
macro: Properly parse !ENCLOSE keyword arguments.
The opening delimiter was being included in the argument.
Thanks to Frans Houweling for reporting this bug.
Ben Pfaff [Tue, 20 Jul 2021 05:10:27 +0000 (22:10 -0700)]
DEFINE: Don't use PSPP_CHECK_MACRO_EXPANSION macro in tests.
I found that this macro just obscured things, so I expanded it in each
case and removed the macro itself.
Ben Pfaff [Tue, 20 Jul 2021 03:49:32 +0000 (20:49 -0700)]
DEFINE: Allow !DEFAULT to follow the argument type declaration.
Frans Houweling reported that SPSS allows either order.
Ben Pfaff [Sun, 18 Jul 2021 21:21:24 +0000 (14:21 -0700)]
lexer: Change the pipeline to allow more flexible use of macros.
Frans Houweling reported that a use of macros in the following way:
DEFINE !dir() "/directory/to/my/work" !ENDDEFINE.
GET FILE=!dir + "/filename.sav".
did not work properly with the newly implemented PSPP macro facility.
Indeed, PSPP has until now implemented string concatenation early in the
lexical pipeline, before macro expansion, so that the above could
not work. This commit reworks it so that string concatenation happens
as the last stage in lexical analysis. It allows the above syntax
to work as expected.
Ben Pfaff [Sun, 18 Jul 2021 21:20:06 +0000 (14:20 -0700)]
str: New function ss_swap().
Ben Pfaff [Mon, 5 Jul 2021 22:15:45 +0000 (15:15 -0700)]
segment: Make negative numbers into single segments.
Ben Pfaff [Mon, 5 Jul 2021 20:46:32 +0000 (13:46 -0700)]
configure: Enable GCC warnings to report use of C2x features.
One C2x feature in GCC 11 is the reason that the previous commit
afda22462a88 ("Fix broken build due to missing braces") was needed by
some developers.
John Darrington [Sun, 4 Jul 2021 17:44:07 +0000 (19:44 +0200)]
Fix broken build due to missing braces
Ben Pfaff [Sun, 4 Jul 2021 05:05:35 +0000 (22:05 -0700)]
DEFINE: New command.
Ben Pfaff [Sun, 4 Jul 2021 16:43:09 +0000 (09:43 -0700)]
lexer: Move lex_ellipsize() into string module, as str_ellipsize().
Ben Pfaff [Sun, 4 Jul 2021 05:20:55 +0000 (22:20 -0700)]
token: Update functional interface and add token_copy(), token_equal().
These will have users in an upcoming commit.
Ben Pfaff [Sun, 4 Jul 2021 05:10:26 +0000 (22:10 -0700)]
segment: Ignore !ENDDEFINE in /*comments*/ and "strings".