pspp
14 months agotransformations: Fix memory error in trns_chain_prepend().
Ben Pfaff [Fri, 19 Apr 2024 00:27:12 +0000 (17:27 -0700)]
transformations: Fix memory error in trns_chain_prepend().

This only worked if the transformation chain had one element.

Thanks to Zhou Geng for reporting this bug as poc30 in the report here:
https://lists.gnu.org/archive/html/bug-gnu-pspp/2024-03/msg00015.html

14 months agoLIST: Fix bug listing duplicate variables.
Ben Pfaff [Sun, 14 Apr 2024 17:07:16 +0000 (10:07 -0700)]
LIST: Fix bug listing duplicate variables.

Thanks to Zhou Geng for reporting this bug as poc28 in the report here:
https://lists.gnu.org/archive/html/bug-gnu-pspp/2024-03/msg00015.html

14 months agoSHOW: Fix memory leak on error path.
Ben Pfaff [Sun, 14 Apr 2024 16:51:58 +0000 (09:51 -0700)]
SHOW: Fix memory leak on error path.

14 months agoSHOW: Fix crash in SHOW TITLE and SHOW SUBTITLE if there is no (sub)title.
Ben Pfaff [Sun, 14 Apr 2024 16:48:23 +0000 (09:48 -0700)]
SHOW: Fix crash in SHOW TITLE and SHOW SUBTITLE if there is no (sub)title.

Thanks to Zhou Geng for reporting this bug as poc14 in the report here:
https://lists.gnu.org/archive/html/bug-gnu-pspp/2024-03/msg00015.html

14 months agopo: Update translations from translationproject.org.
Ben Pfaff [Sun, 14 Apr 2024 16:44:44 +0000 (09:44 -0700)]
po: Update translations from translationproject.org.

14 months agou8-line: Fix handling of double-width characters in u8_line_reserve().
Ben Pfaff [Sun, 14 Apr 2024 16:14:43 +0000 (09:14 -0700)]
u8-line: Fix handling of double-width characters in u8_line_reserve().

This code was terribly confusing.  This adds a little redundancy but it is
easier to understand.

This is difficult logic and more bugs may lurk.

Thanks to Zhou Geng for reporting this bug as poc13 in the report here:
https://lists.gnu.org/archive/html/bug-gnu-pspp/2024-03/msg00015.html

14 months agou8-line: Fix read past end of buffer in u8_line_find_pos().
Ben Pfaff [Sun, 14 Apr 2024 16:11:12 +0000 (09:11 -0700)]
u8-line: Fix read past end of buffer in u8_line_find_pos().

15 months agoFix bug found by fuzzer.
Ben Pfaff [Thu, 4 Apr 2024 20:53:36 +0000 (13:53 -0700)]
Fix bug found by fuzzer.

Thanks to Zhou Geng for reporting this bug as poc9 in the report here:
https://lists.gnu.org/archive/html/bug-gnu-pspp/2024-03/msg00015.html

15 months agopo: Update translations from translationproject.org.
Ben Pfaff [Wed, 3 Apr 2024 20:11:38 +0000 (13:11 -0700)]
po: Update translations from translationproject.org.

15 months agopo: Update translations from translationproject.org.
Ben Pfaff [Mon, 1 Apr 2024 17:38:23 +0000 (10:38 -0700)]
po: Update translations from translationproject.org.

15 months agopo: Update translations from translationproject.org.
Ben Pfaff [Fri, 29 Mar 2024 15:47:09 +0000 (08:47 -0700)]
po: Update translations from translationproject.org.

15 months agopo: Update translations from translationproject.org.
Ben Pfaff [Thu, 28 Mar 2024 17:17:11 +0000 (10:17 -0700)]
po: Update translations from translationproject.org.

15 months agopo: Update translations from translationproject.org.
Ben Pfaff [Mon, 25 Mar 2024 16:26:18 +0000 (09:26 -0700)]
po: Update translations from translationproject.org.

15 months agogui: Translate names of aggregation functions in bar chart dialog.
Ben Pfaff [Mon, 25 Mar 2024 16:24:25 +0000 (09:24 -0700)]
gui: Translate names of aggregation functions in bar chart dialog.

Thanks to Mindaugus for reporting the problem.

15 months agoRelease version 2.0.1.
Ben Pfaff [Thu, 21 Mar 2024 23:32:43 +0000 (16:32 -0700)]
Release version 2.0.1.

15 months agodoc: Document how to run command-line PSPP from the Flatpak.
Ben Pfaff [Thu, 21 Mar 2024 20:28:25 +0000 (13:28 -0700)]
doc: Document how to run command-line PSPP from the Flatpak.

15 months agoREADME.Git: Update to latest version of Gnulib branch stable-202307.
Ben Pfaff [Thu, 21 Mar 2024 14:01:04 +0000 (07:01 -0700)]
README.Git: Update to latest version of Gnulib branch stable-202307.

15 months agoREPEATING DATA: Remove documentation for unimplemented command.
Ben Pfaff [Thu, 21 Mar 2024 13:44:03 +0000 (06:44 -0700)]
REPEATING DATA: Remove documentation for unimplemented command.

This command once had a buggy implementation, which was removed, but the
documentation remained.

Thanks to Frans Houweling for reporting the inconsistency.

15 months agogui: Mark "Show tips at startup" for translation.
Ben Pfaff [Thu, 21 Mar 2024 13:40:39 +0000 (06:40 -0700)]
gui: Mark "Show tips at startup" for translation.

Thanks to Mindaugus for reporting that it was missing.

15 months agopo: Update translations from translationproject.org
Ben Pfaff [Thu, 21 Mar 2024 13:38:14 +0000 (06:38 -0700)]
po: Update translations from translationproject.org

15 months agoDO REPEAT: Accept duplicate names as substitution variables.
Ben Pfaff [Thu, 21 Mar 2024 13:32:56 +0000 (06:32 -0700)]
DO REPEAT: Accept duplicate names as substitution variables.

Thanks to Frans Houweling for reporting the bug.

16 months agoCROSSTABS: Fix tabular output when columns or rows are empty.
Ben Pfaff [Wed, 6 Mar 2024 22:32:41 +0000 (14:32 -0800)]
CROSSTABS: Fix tabular output when columns or rows are empty.

Thanks to Andreas Hammer for reporting the bug.

16 months agoAUTORECODE: Fix crash if scratch variables created before source variables.
Ben Pfaff [Sun, 3 Mar 2024 20:05:05 +0000 (12:05 -0800)]
AUTORECODE: Fix crash if scratch variables created before source variables.

Thanks to Frans Houweling for reporting this bug.

16 months agodictionary: Remove unused functions and prototypes.
Ben Pfaff [Sat, 2 Mar 2024 19:08:29 +0000 (11:08 -0800)]
dictionary: Remove unused functions and prototypes.

16 months agopsppire: Sort by name or label case-insensitively in dictionary view.
Ben Pfaff [Fri, 1 Mar 2024 19:20:38 +0000 (11:20 -0800)]
psppire: Sort by name or label case-insensitively in dictionary view.

Thanks to Elio Spinello for reporting the bug.

16 months agoSORT VARIABLES: Add test case for case sensitivity.
Ben Pfaff [Fri, 1 Mar 2024 18:45:23 +0000 (10:45 -0800)]
SORT VARIABLES: Add test case for case sensitivity.

16 months agoCTABLES: Fix crash with single nesting level, no label, and moving labels.
Ben Pfaff [Sat, 24 Feb 2024 18:50:02 +0000 (10:50 -0800)]
CTABLES: Fix crash with single nesting level, no label, and moving labels.

This fixes a crash for the following input:

DATA LIST LIST NOTABLE /year (F4.0).
BEGIN DATA
2020
2021
2022
2020
2020
END DATA.

CTABLES
  /VLABELS VARIABLES=year DISPLAY=NONE
  /TABLE year [C]
  /CLABELS ROWLABELS=OPPOSITE.

Thanks to Frans Houweling for reporting this bug and providing the test
case.

18 months agotests: Remove two tests that proved problematic cross-OS and cross-arch.
Ben Pfaff [Sun, 7 Jan 2024 19:09:07 +0000 (11:09 -0800)]
tests: Remove two tests that proved problematic cross-OS and cross-arch.

The test "journal enabled by default interactively" failed in Debian
testing on s390x, powerpc, and ppc64.  I can't reproduce the problem on
x86_64.  This commit removes it.

The test "interactive output appears immediately" failed in Debian testing
on s390x, hppa, powerpc, and ppc64.  It also previously failed on Mac OS.
I can reproduce the problem on x86_64 if readline isn't available, but not
if it is.  (I think it would always be available for Debian).  This commit
removes it.

Thanks to Friedrich Beckmann for reporting the Debian build problems.

18 months agodoc: set LANG=C for building the tutorial images
Friedrich Beckmann [Thu, 4 Jan 2024 11:04:15 +0000 (12:04 +0100)]
doc: set LANG=C for building the tutorial images

The build process fails if the shell has set a different language
setting the us. This patch sets the language during the generation
of the documentation images.

Closes: https://savannah.gnu.org/bugs/?65124
18 months agoUpdate releases in appstream metadata to make flathub happy.
Ben Pfaff [Mon, 1 Jan 2024 00:48:56 +0000 (16:48 -0800)]
Update releases in appstream metadata to make flathub happy.

18 months agoRelease version 2.0.0.
Ben Pfaff [Sun, 31 Dec 2023 23:13:35 +0000 (15:13 -0800)]
Release version 2.0.0.

20 months agoMacOS: Fix skipped test "convert invalid UTF-8 to ISO-8859-1"
Friedrich Beckmann [Sun, 5 Nov 2023 19:59:37 +0000 (20:59 +0100)]
MacOS: Fix skipped test "convert invalid UTF-8 to ISO-8859-1"

The skipping worked, but the non-skipped test failed on linux
systems.

20 months agoRevert "Revert "MacOS: skip test "convert invalid UTF-8 to ISO-8859-1"""
Ben Pfaff [Sun, 5 Nov 2023 19:12:18 +0000 (11:12 -0800)]
Revert "Revert "MacOS: skip test "convert invalid UTF-8 to ISO-8859-1"""

This reverts commit bcc19d9457129559b836a0cc6cd81e2c71d42bb5.
Just letting Mac OS crash on invalid conversions seems like the
most reasonable path for now.  Maybe Apple will fix their buggy
iconv.

20 months agoRevert "i18n.c: added EOPNOTSUPP error code for MacOS"
Ben Pfaff [Sun, 5 Nov 2023 19:11:41 +0000 (11:11 -0800)]
Revert "i18n.c: added EOPNOTSUPP error code for MacOS"

This reverts commit 1799abc8539bd1a49c72c5723d1fa89ff4463e3f.
Handling EOPNOTSUPP like EILSEQ produced a hang rather than
the expected results, so this was a failed experiment.

20 months agoUpgrade to stable Gnulib branch stable-202307.
Ben Pfaff [Sun, 5 Nov 2023 18:10:06 +0000 (10:10 -0800)]
Upgrade to stable Gnulib branch stable-202307.

Suggested by Bruno Haible.

20 months agoi18n.c: added EOPNOTSUPP error code for MacOS
Friedrich Beckmann [Sat, 4 Nov 2023 22:28:40 +0000 (23:28 +0100)]
i18n.c: added EOPNOTSUPP error code for MacOS

With MacOS 14 the iconv library was changed by Apple. pspp uses
the native iconv library. There is a different error code
returned when an illegal 0xc0 UTF-8 code is converted. This
results in a failed "convert invalid UTF-8 to ISO-8859-1" test in
the regression. This patch now handles also EOPNOTSUPP.

20 months agoRevert "MacOS: skip test "convert invalid UTF-8 to ISO-8859-1""
Friedrich Beckmann [Sat, 4 Nov 2023 22:11:57 +0000 (23:11 +0100)]
Revert "MacOS: skip test "convert invalid UTF-8 to ISO-8859-1""

This reverts commit 579295f8b15068b121807168e84330c1f99361e9. Ben
has an idea how to fix this in libpspp to handle the different
error code on MacOS.

20 months agoMacOS: skip test "convert invalid UTF-8 to ISO-8859-1"
Friedrich Beckmann [Sat, 4 Nov 2023 18:40:50 +0000 (19:40 +0100)]
MacOS: skip test "convert invalid UTF-8 to ISO-8859-1"

Starting with MacOS 14 Sonoma Apple has changed the behaviour
of the iconv library. The test tests the behaviour for invalid
UTF-8 sequence 0xC0. The native Apple iconv library responds with
a different error number than expected. This patch skips the
test on MacOS until this is hopefully fixed on MacOS.

20 months agoUnconditionally replace g_string_free_and_steal().
Ben Pfaff [Sat, 4 Nov 2023 00:29:14 +0000 (17:29 -0700)]
Unconditionally replace g_string_free_and_steal().

It's a persistent problem and I don't understand why.  I hope this fixes
the issue for good.

Thanks to Ali Alhaidary for reporting this bug.

Bug #64848.

20 months agoRelease version 2.0.0-pre3.
Ben Pfaff [Thu, 2 Nov 2023 21:27:39 +0000 (14:27 -0700)]
Release version 2.0.0-pre3.

20 months agotests: Fall back to running the interactive output test on GNU/Linux only.
Ben Pfaff [Thu, 2 Nov 2023 15:55:28 +0000 (08:55 -0700)]
tests: Fall back to running the interactive output test on GNU/Linux only.

It fails on Mac OS for unclear reasons.

20 months agotests: Refine the last change.
Ben Pfaff [Thu, 2 Nov 2023 02:31:03 +0000 (19:31 -0700)]
tests: Refine the last change.

The remaining failures might be attributable to journal file creation
errors.

20 months agotests: Try another strategy to check for immediate output.
Ben Pfaff [Thu, 2 Nov 2023 01:41:57 +0000 (18:41 -0700)]
tests: Try another strategy to check for immediate output.

The previous strategy hung on some machines and failed on others.  The
failures are sometimes sensitive to whether libreadline is available.  I
hope that this avoids the problem.

20 months agotests: Stop using squish-pty.
Ben Pfaff [Wed, 1 Nov 2023 16:40:02 +0000 (09:40 -0700)]
tests: Stop using squish-pty.

squish-pty seems to break easily, so switch to using another way to
simulate interactive behavior.  This way requires a small source code
change to PSPP itself but it should be more portable.

Thanks to Friedrich Beckmann for reporting the problem.  The problem that
Friedrich reported was a hang in the "interactive output appears
immediately" test on Debian sid.  I couldn't reproduce that problem on
Fedora or Debian testing, but I did get failures on Debian testing.  I
guess it's best to just avoid ptys at all.

20 months agoFix typo in user string.
Ben Pfaff [Wed, 1 Nov 2023 14:35:31 +0000 (07:35 -0700)]
Fix typo in user string.

Thanks to Benno Schulenberg for reporting this bug.

20 months agopo: Update translations from translationproject.org.
Ben Pfaff [Wed, 1 Nov 2023 14:26:22 +0000 (07:26 -0700)]
po: Update translations from translationproject.org.

20 months agoRelease version 2.0.0-pre2.
Ben Pfaff [Wed, 1 Nov 2023 03:26:27 +0000 (20:26 -0700)]
Release version 2.0.0-pre2.

20 months agoEnable journaling by default and add GUI feature for configuring it.
Ben Pfaff [Sat, 7 Oct 2023 21:31:50 +0000 (14:31 -0700)]
Enable journaling by default and add GUI feature for configuring it.

21 months agoMATCH FILES: Fix crash in string variable resizing.
Ben Pfaff [Sat, 30 Sep 2023 20:19:21 +0000 (13:19 -0700)]
MATCH FILES: Fix crash in string variable resizing.

Commmit 638bf380e550 ("combine-files: Allow matching string
variables to have different widths.") introduced a bug in the
case where the variables in data files being combined didn't
have the same variable order.  This is kind of an
embarrassing bug since the input files having the same order
of variables is an exceptional case anyhow.  This commit
should fix the problem.

The test as updated will crash if the bug regresses.

Thanks to Frans Houweling for reporting the bug.

21 months agosettings: Make PRESERVE, RESTORE, and SHOW handle TLOOK.
Ben Pfaff [Sat, 30 Sep 2023 19:21:53 +0000 (12:21 -0700)]
settings: Make PRESERVE, RESTORE, and SHOW handle TLOOK.

Thanks to Frans Houweling for reporting the issue.

21 months agopsppire-import-textfile: Default to using column names from imported file.
Ben Pfaff [Sat, 30 Sep 2023 18:27:08 +0000 (11:27 -0700)]
psppire-import-textfile: Default to using column names from imported file.

We speculate that users will find this less surprising.

Suggested by Alan Mead.

21 months agoONEWAY: Improve handling of missing values in ONEWAY multiple comparisons.
Ben Pfaff [Sat, 30 Sep 2023 17:48:39 +0000 (10:48 -0700)]
ONEWAY: Improve handling of missing values in ONEWAY multiple comparisons.

Thanks to Andreas Hammer for the bug report and example data.

22 months agopspp-dump-sav: Number variables in cases starting from 1.
Ben Pfaff [Tue, 5 Sep 2023 15:34:52 +0000 (08:34 -0700)]
pspp-dump-sav: Number variables in cases starting from 1.

The variables are numbered starting from 1 elsewhere in the output, so they
should be in the cases as well.

Bug #64621.
Thanks to Daniel for reporting this bug.

2 years agoFixed an assertion failure in psppire-dump-sav when reading a corrupt file.
John Darrington [Sun, 25 Jun 2023 16:20:39 +0000 (18:20 +0200)]
Fixed an assertion failure in psppire-dump-sav when reading a corrupt file.

Closes bug #62980

2 years agoSimplify drag-drop target settings in CTABLES dialog
John Darrington [Sun, 25 Jun 2023 04:17:14 +0000 (06:17 +0200)]
Simplify drag-drop target settings in CTABLES dialog

2 years agohtml: Include generic font-family name "sans-serif" as a fallback.
Ben Pfaff [Sat, 24 Jun 2023 17:04:48 +0000 (10:04 -0700)]
html: Include generic font-family name "sans-serif" as a fallback.

https://developer.mozilla.org/en-US/docs/Web/CSS/font-family recommends
that a font-family specification should always include one of the generic
font-family names to serve as a fallback.  For PSPP, sans-serif is a
reasonable fixed fallback.

This addresses bug #63020, which asks for "Sans Serif" to mean sans-serif.
It obviously doesn't generalize to other font name translations, but it
does address the case that the bug filer complained about.  If we need a
more general mechanism, we can invent it later.

Thanks to Frans Houweling for reporting this issue.

2 years agoAdd localisations for ar and ta domains
John Darrington [Sat, 24 Jun 2023 04:48:29 +0000 (06:48 +0200)]
Add localisations for ar and ta domains

2 years agoRemove Find and Close from the list of default button box buttons
John Darrington [Fri, 23 Jun 2023 12:22:51 +0000 (14:22 +0200)]
Remove Find and Close from the list of default button box buttons

Commit e1a2cf577fac791c79cd531e688a48efab9b7c0c inappropiratly added the FIND
and CLOSE buttons to the default list of buttons to be shown.  This change
fixes that error.

2 years agoWhitespace changes only.
John Darrington [Fri, 23 Jun 2023 06:09:47 +0000 (08:09 +0200)]
Whitespace changes only.

2 years agoFix the cleanup of the pivot table in the CTABLES dialog
John Darrington [Wed, 21 Jun 2023 14:49:11 +0000 (16:49 +0200)]
Fix the cleanup of the pivot table in the CTABLES dialog

2 years agoProperly dispose of psppire_dialog_action objects when the data editor is closed
John Darrington [Wed, 21 Jun 2023 13:41:29 +0000 (15:41 +0200)]
Properly dispose of psppire_dialog_action objects when the data editor is closed

2 years agoFixed a crash when trying to insert variables into the datasheet
John Darrington [Wed, 21 Jun 2023 10:02:06 +0000 (12:02 +0200)]
Fixed a crash when trying to insert variables into the datasheet

2 years agoFix cut-and-paste error in comment
John Darrington [Wed, 21 Jun 2023 09:44:23 +0000 (11:44 +0200)]
Fix cut-and-paste error in comment

2 years agoChange TAB characters to spaces
John Darrington [Tue, 20 Jun 2023 20:11:51 +0000 (22:11 +0200)]
Change TAB characters to spaces

Most of our code is indented with four spaces.  However some files had been
using tabs.  Some code used both tabs and spaces in the same file!.  This
change replaces all tabs with eight spaces.

2 years agoAdded a new dialog to generate CTABLES
John Darrington [Tue, 20 Jun 2023 16:42:24 +0000 (18:42 +0200)]
Added a new dialog to generate CTABLES

This dialog provides just a small subset of what ought to be available. In
particular, nested tables cannot be specified and only the default summary
functions work.  Other caveats are also present, but it generally provides
a start and proof of concept.

2 years agoUpdate pofiles from translationproject.org
John Darrington [Tue, 20 Jun 2023 13:49:15 +0000 (15:49 +0200)]
Update pofiles from translationproject.org

2 years agoRemove trailing whitespace from files
John Darrington [Tue, 20 Jun 2023 12:37:39 +0000 (14:37 +0200)]
Remove trailing whitespace from files

2 years agoExpose pivot_category_dump to global scope.
John Darrington [Tue, 20 Jun 2023 06:22:10 +0000 (08:22 +0200)]
Expose pivot_category_dump to global scope.

This function is useful for debugging during development of users of
pivot tables.

2 years agoWarn about MacOS
John Darrington [Mon, 19 Jun 2023 19:27:05 +0000 (21:27 +0200)]
Warn about MacOS

2 years agooutput_item_unref: Avoid a level of indentation
John Darrington [Mon, 19 Jun 2023 18:29:36 +0000 (20:29 +0200)]
output_item_unref: Avoid a level of indentation

2 years agoAdd a callback from PsppireDialog on GtkDrawingArea draw signals.
John Darrington [Mon, 19 Jun 2023 18:25:59 +0000 (20:25 +0200)]
Add a callback from PsppireDialog on GtkDrawingArea draw signals.

If a PsppireDialog contains a GtkDrawingArea, potentially any change
to the drawn surface could indicate a change in state.  Therefore,
we need to notify interested parties of this change.

2 years agoMake the page breaking in the TeX driver a little better
John Darrington [Sun, 18 Jun 2023 13:21:09 +0000 (15:21 +0200)]
Make the page breaking in the TeX driver a little better

2 years agoRevert recent changes to configure.ac
John Darrington [Sun, 18 Jun 2023 11:07:45 +0000 (13:07 +0200)]
Revert recent changes to configure.ac

Commit e1a2cf577fac791c79cd531e688a48efab9b7c0c recented gtksourceview to
version 4.8  - However this turned out to be unnecessary, so this change
reverts that detail.

2 years agopsppire-output-view: remove set but unused variable
John Darrington [Sun, 18 Jun 2023 10:19:32 +0000 (12:19 +0200)]
psppire-output-view: remove set but unused variable

2 years agoFix clipboard paste data negotiation
John Darrington [Sat, 17 Jun 2023 09:44:20 +0000 (11:44 +0200)]
Fix clipboard paste data negotiation

Fixed a bug which caused pasting of output to programs such as libreoffice to
get pasted as images instead of editable tables.

2 years agoRe-implemented the search dialog for the syntax editor
John Darrington [Fri, 16 Jun 2023 15:14:41 +0000 (17:14 +0200)]
Re-implemented the search dialog for the syntax editor

This new dialog offers a lot more features, such as case insensitivity,
backward searching etc.   This change also removes the option to build
against gtksourceview-3 - gtksourceview-4 is now required.

2 years agoImplement the SET SUMMARY command
John Darrington [Wed, 7 Jun 2023 15:45:35 +0000 (17:45 +0200)]
Implement the SET SUMMARY command

2 years agoUpdate copyright dates of documentation
John Darrington [Tue, 6 Jun 2023 19:25:22 +0000 (21:25 +0200)]
Update copyright dates of documentation

2 years agoFix possible divide by zero error
John Darrington [Sun, 4 Jun 2023 16:10:24 +0000 (18:10 +0200)]
Fix possible divide by zero error

2 years agoFix memory leak
John Darrington [Sun, 4 Jun 2023 15:30:15 +0000 (17:30 +0200)]
Fix memory leak

2 years agoFix minor English grammar errors, mostly "a" versus "an".
Ben Pfaff [Sun, 4 Jun 2023 14:57:24 +0000 (07:57 -0700)]
Fix minor English grammar errors, mostly "a" versus "an".

I spotted one of these and then found the rest via "grep".

2 years agolexer: New function for other kind of half-open range.
Ben Pfaff [Sun, 4 Jun 2023 14:52:11 +0000 (07:52 -0700)]
lexer: New function for other kind of half-open range.

The existing function lex_force_num_range_halfopen() handled ranges of the
form [low,high).  There is a new need for (low,high] ranges.  This commit
adds that new function and renames the existing one so that it's obvious
which kind it handles.

2 years agodictionary: Properly size string buffer in make_hinted_name().
Ben Pfaff [Sun, 4 Jun 2023 14:40:47 +0000 (07:40 -0700)]
dictionary: Properly size string buffer in make_hinted_name().

This causes a test failure on 32-bit platforms, where
INT_BUFSIZE_BOUND(unsigned long) is smaller than F26ADIC_STRLEN_MAX + 1.

Fixes: 2ba8dc2955f8 ("spreadsheet-reader: Merge duplicate code with libpspp/str.h.")
Thanks to Friedrich Beckmann for reporting the problem.

2 years agoMEANS: Allow string variables to be selected as the categorical variable.
John Darrington [Sat, 3 Jun 2023 20:01:12 +0000 (22:01 +0200)]
MEANS: Allow string variables to be selected as the categorical variable.

The gui did not allow string variables to be the subject of any MEANS command.
However it is entirely appropriate for them to be the independent (categorical)
variable.

2 years agospreadsheet-reader: Merge duplicate code with libpspp/str.h.
Ben Pfaff [Sat, 3 Jun 2023 17:02:28 +0000 (10:02 -0700)]
spreadsheet-reader: Merge duplicate code with libpspp/str.h.

The tree had two functions for 26-adic spreadsheet number formatting.  This
eliminates the duplication and moves the corresponding parsing function
into str.h as well.

2 years agotests: Fix PostgreSQL test.
Ben Pfaff [Wed, 31 May 2023 21:31:09 +0000 (14:31 -0700)]
tests: Fix PostgreSQL test.

2 years agoPortability/Regression: Check OS version to skip test first (1598)
Friedrich Beckmann [Tue, 30 May 2023 08:25:16 +0000 (10:25 +0200)]
Portability/Regression: Check OS version to skip test first (1598)

The test

1598: interactive output appears immediately

does not work on MacOS and the plan is to skip that test. I changed
the testcode to first test the OS and skip immediately instead of
first checking the python shell. Without that the test does not
stop on MacOS and runs forever.

2 years agoPortability: Variable initialization not at beginning of block
Friedrich Beckmann [Tue, 30 May 2023 08:21:08 +0000 (10:21 +0200)]
Portability: Variable initialization not at beginning of block

Recent changes in segment.c result in compilation errors on older
compilers like on debian buster or MacOS.

../pspp/src/language/lexer/segment.c:1255:7:
error: a label can only be part of a statement
and a declaration is not a statement
       int eol = at_end_of_line (input, n, eof, 1);

I changed the code such that it compiles on MacOS again to
a more traditional way to avoid the compile error.

2 years agoods-reader: Support more than a single piece of text in a cell.
Ben Pfaff [Tue, 30 May 2023 00:42:15 +0000 (17:42 -0700)]
ods-reader: Support more than a single piece of text in a cell.

This code read the first text content in the first <p> it found in a cell.
This meant that anything more sophisticated than just <p>text<p> broke,
including <p>text<span>some more</span></p>.  This commit fixes it.

The code here was really complicated and I didn't understand it.  I
simplified it a lot to use xmlTextReaderExpand(), which is a lot easier to
use than a state machine at the level we need it.  I also couldn't figure
out how to make the existing caching logic work quite right, so I replaced
it by something simpler which I think will be just fine.

This updates the test by adding some bold text to a cell.

Thanks to elias tsolis for reporting this bug.
Bug #63443.

2 years agospreadsheet-test: Fix usage message.
Ben Pfaff [Tue, 30 May 2023 00:37:52 +0000 (17:37 -0700)]
spreadsheet-test: Fix usage message.

2 years agoods-reader: Integrate xmlTextReaderRead() calls into process_node().
Ben Pfaff [Mon, 29 May 2023 23:36:20 +0000 (16:36 -0700)]
ods-reader: Integrate xmlTextReaderRead() calls into process_node().

This will allow using xmlTextReaderNext() instead of xmlTextReaderRead()
for some kinds of nodes.

2 years agotests: Add some keywords for ODS and gnumeric tests.
Ben Pfaff [Mon, 29 May 2023 23:33:17 +0000 (16:33 -0700)]
tests: Add some keywords for ODS and gnumeric tests.

2 years agogui: Update how the Run menu works in the syntax window.
Ben Pfaff [Mon, 29 May 2023 20:23:07 +0000 (13:23 -0700)]
gui: Update how the Run menu works in the syntax window.

Until now, the Run menu had both "Selection", which ran the current
selection, and "Current line", which ran the current line.  This commit
replaces that by a single menu item "Selection", which runs the current
command if there is no selection and all the selected or partially selected
commands if there is a selection.  This behavior matches SPSS.

Requested by Matthias Faeth.

2 years agocommand-segmenter: New library for dividing syntax into individual commands.
Ben Pfaff [Mon, 29 May 2023 20:09:09 +0000 (13:09 -0700)]
command-segmenter: New library for dividing syntax into individual commands.

This is a building block for allowing the GUI to run whole commands instead
of just lines.

2 years agodeque: Replace deque_init_null() by DEQUE_EMPTY_INITIALIZER.
Ben Pfaff [Mon, 29 May 2023 20:21:07 +0000 (13:21 -0700)]
deque: Replace deque_init_null() by DEQUE_EMPTY_INITIALIZER.

2 years agoidentifier: Fix typo in comment.
Ben Pfaff [Mon, 29 May 2023 20:06:41 +0000 (13:06 -0700)]
identifier: Fix typo in comment.

2 years agoCTABLES: Avoid causing nhtsa.sav to appear modified after running tests.
Ben Pfaff [Sun, 28 May 2023 16:31:00 +0000 (09:31 -0700)]
CTABLES: Avoid causing nhtsa.sav to appear modified after running tests.

Adding a hard link makes Git think that nhtsa.sav has been modified, before
it checks for real changes, which is sometimes annoying in the interface.
Using a symlink instead avoids the problem.

2 years agoCTABLES: Refine treatment for applying a summary to nested variables.
Ben Pfaff [Sun, 28 May 2023 16:27:33 +0000 (09:27 -0700)]
CTABLES: Refine treatment for applying a summary to nested variables.

In the previous commit, applying a summary to a nest operator caused an
error, which I assumed was the correct behvior.  This commit changes it
to apply the summary to the inner variable.

Thanks to Matthias Faeth for reporting the correct behavior.

2 years agoCTABLES: Don't crash for attempting to apply a summary to nested variables.
Ben Pfaff [Sun, 28 May 2023 06:18:31 +0000 (23:18 -0700)]
CTABLES: Don't crash for attempting to apply a summary to nested variables.

Thanks to Matthias Faeth for reporting this bug.

2 years agoCTABLES: Stop parsing after a summary spec error.
Ben Pfaff [Sun, 28 May 2023 06:17:32 +0000 (23:17 -0700)]
CTABLES: Stop parsing after a summary spec error.