- 03 Dec, 2021 1 commit
-
-
Sebastian Dröge authored
gfileutils: Fix transfer annotation and whitespace issues See merge request GNOME/glib!2385
-
- 02 Dec, 2021 9 commits
-
-
Phaedrus Leeds authored
-
Sebastian Dröge authored
gfileutils: Correctly reset start value when canonicalising paths See merge request GNOME/glib!2382
-
Philip Withnall authored
If a path starts with more than two slashes, the `start` value was previously incorrect: 1. As per the `g_path_skip_root()` call, `start` was set to point to after the final initial slash. For a path with three initial slashes, this is the character after the third slash. 2. The canonicalisation loop to find the first dir separator sets `output` to point to the character after the first slash (and it overwrites the first slash to be `G_DIR_SEPARATOR`). 3. At this point, with a string `///usr`, `output` points to the second `/`; and `start` points to the `u`. This is incorrect, as `start` should point to the starting character for output, as per the original call to `g_path_skip_root()`. 4. For paths which subsequently include a `..`, this results in the `output > start` check in the `..` loop below not skipping all the characters of a preceding path component, which is then caught by the `G_IS_DIR_SEPARATOR (output[-1])` assertion. Fix this by resetting `start` to `output` after finding the final slash to keep in the output, but before starting the main parsing loop. Relatedly, split `start` into two variables: `after_root` and `output_start`, since the variable actually has two roles in the two parts of the function. Includes a test. This commit is heavily based on suggestions by Sebastian Wilhemi and Sebastian Dröge. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org> oss-fuzz#41563
-
(cherry picked from commit 711efa50)
-
Philip Withnall authored
Clarify the code a little. This introduces no functional changes. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Sebastian Dröge authored
tests: Test the function forms of g_bit_*() APIs too See merge request GNOME/glib!2381
-
Philip Withnall authored
The tests were previously only checking the macro forms. The function forms should behave identically, but since it’s easy enough to get coverage of them, we might as well. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
This decreases the overall test time from 0.17s to 0.12s for me, and will help further in the following commit where I’m going to repeat some of these calculations again for further comparisons. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
Merging tests/bit-test.c into glib/tests/utils.c See merge request GNOME/glib!2379
-
- 01 Dec, 2021 3 commits
-
-
Emmanuel Fleury authored
-
Philip Withnall authored
GSource: move test to glib/tests/ See merge request GNOME/glib!2376
-
Nishal Kulkarni authored
Previously tests existed in two places, `$top_srcdir/tests/sources.c` contained additional tests, they have now been moved to `$top_srcdir/glib/tests/mainloop.c` and `$top_srcdir/tests/sources.c` was deleted. Related to: #1434
-
- 30 Nov, 2021 2 commits
-
-
Philip Withnall authored
gfileutils: Improve performance of g_canonicalize_filename() Closes #2541 See merge request GNOME/glib!2374
-
Philip Withnall authored
Removing tests/asyncqueue-test.c from tests/ See merge request GNOME/glib!2347
-
- 29 Nov, 2021 7 commits
-
-
Emmanuele Bassi authored
glib.supp: Suppress one-time allocation in g_get_home_dir() See merge request GNOME/glib!2373
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Sebastian Dröge authored
Freeze notification during object destruction See merge request GNOME/glib!2371
-
Emmanuel Fleury authored
Tests on async queues are already performed in a more extensive way in glib/tests/asyncqueue.c. This test file can be safely removed without any loss.
-
Emmanuele Bassi authored
Notifying during object destruction is a dubious "feature": objects might end up recreating a bunch of state just before clearing it; language bindings might get spurious notifications during garbage collection runs. We freeze the notification queue before running the dispose() chain; if the object was temporarily vivified during dispose, we thaw the notification queue, otherwise we let the instance clear it when we finalize it. See: GNOME/gjs#445
-
Sebastian Dröge authored
docs: Improve GVariant docs See merge request GNOME/glib!2372
-
Mohammed Sadiq authored
Fix a typo and expand examples to include freeing memory where it's not obvious
-
- 28 Nov, 2021 2 commits
-
-
-
(cherry picked from commit 816d4c30)
-
- 26 Nov, 2021 16 commits
-
-
Philip Withnall authored
gqsort: Move test to glib/tests/ See merge request GNOME/glib!2370
-
Nishal Kulkarni authored
Previously tests existed in two places, `$top_srcdir/tests/qsort-test.c` contained a similar test to the one in `$top_srcdir/glib/tests/sort.c` called `test_sort_basic()` The test for checking with zero elements was additional added to `$top_srcdir/glib/tests/sort.c` and `$top_srcdir/tests/qsort-test.c` was deleted. Related to: #1434
-
-
Daniel Mustieles García authored
-
Improve the performance of canonicalising filenames with many `..` or `.` components, by modifying the path inline rather than calling `memmove()`. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org> Fixes: #2541
-
Philip Withnall authored
galloca: Add new API g_alloca0 and g_newa0 Closes #475 See merge request GNOME/glib!2367
-
Sebastian Dröge authored
tests: Unset CHARSET when testing locales to avoid it breaking tests Closes #2514 See merge request GNOME/glib!2369
-
Replace `g_alloca()` and `memset()` with `g_alloca0()`
-
Replace old `g_newa()` and `memset()` with `g_newa0()`
-
Replace old `g_newa()` and `memset()` with `g_newa0()`
-
Replace old `g_alloca()` and `memset()` with `g_newa0()`
-
Replace `g_alloca()` and `memset()` with `g_alloca0()`
-
Replace old `g_alloca()` and `memset()` with `g_newa0()`
-
Added `g_alloca0()` which wraps `g_alloca()` and initializes allocated memory to zeroes. Added `g_newa0()` which wraps `g_alloca0()` in a typesafe manner. Refreshed and tweaked by Nishal Kulkarni.
-
Philip Withnall authored
The charset set in `CHARSET` overrides the charset after the `.` in any `LC_*` category (set via the environment or `setlocale()`). This will break many tests, but in particular it definitely breaks the `/GDateTime/format_mixed/` tests which are specifically checking different charsets being set for different `LC_*` categories. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org> Fixes: #2514
-
Philip Withnall authored
Users should probably never be setting this — instead, just add the charset after a `.` in `LANGUAGE`/`LC_ALL`/`LC_*`/`LANG`. I can’t find any reference (in `git log`, code comments, or man pages) to this environment variable being standardised or documented or even used anywhere outside GLib. Perhaps it should eventually be removed. If anybody finds references as to why GLib checks `CHARSET`, this comment can be updated in future. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org> Helps: #2514
-