1. 23 Jul, 2020 1 commit
    • Nirbheek Chauhan's avatar
      glib: Use g_getenv everywhere instead of getenv · c3c2c313
      Nirbheek Chauhan authored
      `getenv()` doesn't work well on Windows, f.ex., it can't fetch env
      vars set with `SetEnvironmentVariable()`. This also means that it
      doesn't work at all when targeting UWP since that's the only way to
      set env vars in that case.
  2. 03 Jul, 2020 1 commit
  3. 12 Apr, 2019 1 commit
  4. 07 Jan, 2019 1 commit
    • Philip Withnall's avatar
      gthread: Add g_private_set_alloc0() internal convenience API · f6caeb6d
      Philip Withnall authored
      This is a wrapper around g_private_set() which allocates the desired
      amount of memory for the caller and calls g_private_set() on it.
      This is intended to make it easier to suppress Valgrind warnings about
      leaked memory, since g_private_set() is typically used to make one-time
      per-thread allocations. We can now just add a blanket suppression rule
      for any allocations inside g_private_set_alloc0().
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
  5. 04 Sep, 2018 1 commit
  6. 13 Feb, 2018 1 commit
  7. 09 Feb, 2018 2 commits
  8. 02 Feb, 2018 3 commits
  9. 19 Jan, 2018 3 commits
    • Mikhail Zabaluev's avatar
      gconvert: Consistently validate inputs and outputs for embedded NULs · f35a6a70
      Mikhail Zabaluev authored
      String inputs to convenience conversion functions g_locale_from_utf8(),
      g_filename_from_utf8(), and g_filename_to_utf8(), are annotated for the
      bindings as NUL-terminated strings of (type utf8) or (type filename).
      There is also a len parameter that allows converting part of the string,
      but it is exposed to the bindings as a value independent from the string
      buffer. Absent any more sophisticated ways to annotate, the way to
      provide a safeguard against len argument values longer than the
      string length is to check that no nul is encountered within the first
      len bytes of the string. strdup_len() includes this check as part of
      UTF-8 validation, but g_convert() permits embedded nuls.
      For g_filename_from_utf8(), also check the output to prevent embedded NUL
      bytes. It's not safe to allow embedded NULs in a string that is going
      to be used as (type filename), and no known bytestring encoding for
      file names allows them.
    • Mikhail Zabaluev's avatar
      gconvert: Tighten, document embedded NUL behavior of UTF-8 conversions · 81cd8154
      Mikhail Zabaluev authored
      The character encoding conversion utility functions g_locale_to_utf8()
      and g_filename_to_utf8() had inconsistent behavior on producing strings
      with inner NUL bytes: in the all-UTF-8 strdup path, the input string
      validation prohibits embedded NULs, while g_convert(), using iconv(),
      can produce UTF-8 output with NUL bytes inside the output buffer.
      This, while valid UTF-8 per the Unicode standard, is not valid for
      the nul-terminated (type utf8) return value format that the *_to_utf8()
      functions are annotated with (as per discussion in bug 756128).
      Check the output of g_convert() for embedded NUL bytes, and if any
      are found, set the newly introduced error
      Also document the error set by g_{locale,filename}_{from,to}_utf8()
      when the input string contains nul bytes.
    • Mikhail Zabaluev's avatar
      gconvert: Optimize UTF-8 conversions, fix output on error · 413605a6
      Mikhail Zabaluev authored
      In the strdup_len() path, no need to do what g_utf8_validate()
      already does: locate the string-terminating nul byte.
      Also in strdup_len(), make the out parameter bytes_read receive the length
      of the valid (meaning also nul-free) part of the input string, as the
      documentation on g_{locale,filename}_{from,to}_utf8() says it does.
  10. 11 Jan, 2018 1 commit
  11. 12 Nov, 2017 1 commit
  12. 11 Sep, 2017 1 commit
  13. 24 May, 2017 1 commit
    • Sébastien Wilmet's avatar
      glib/: LGPLv2+ -> LGPLv2.1+ · f9faac76
      Sébastien Wilmet authored
      All glib/*.{c,h} files have been processed, as well as gtester-report.
      12 of those files are not licensed under LGPL:
      Some of them are generated files, some are licensed under a BSD-style
      license and win_iconv.c is in the public domain.
      Sub-directories inside glib/:
      	deprecated/: processed in a previous commit
      	glib-mirroring-tab/: already LGPLv2.1+
      	gnulib/: not modified, the code is copied from gnulib
      	libcharset/: a copy
      	pcre/: a copy
      	tests/: processed in a previous commit
  14. 28 Apr, 2017 1 commit
    • Philip Withnall's avatar
      docs: Fix (nullable) (optional) annotations · b63469d7
      Philip Withnall authored
      There are a few places where commit 18a33f72 replaced valid (nullable)
      (optional) annotations with just (optional). That has a different
      (nullable) (optional) can only be applied to gpointer* parameters, and
      means that both the gpointer* and returned gpointer can be NULL. i.e.
      The caller can pass in NULL to ignore the return value; and the returned
      value can be NULL.
      (optional) can be applied to anything* parameters, and means that the
      anything* can be NULL. i.e. The caller can pass in NULL to ignore the
      return value. The return value cannot be NULL.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
  15. 06 Apr, 2017 1 commit
  16. 02 Mar, 2017 1 commit
    • Paolo Borelli's avatar
      Make g_utf8_make_valid optionally take a length · f559bc01
      Paolo Borelli authored
      g_utf8_make_valid was turned into a public API this cycle. However
      now that it is public we should make the API more generic, allowing
      the caller to specify the length. This is especially useful if
      the function is called with a string that has \0 in the middle
      or for chunks of a strings that are not nul terminated.
      This is also consistent with most of the other utf8 utils.
      Callers inside glib are updated to the new signature.
  17. 22 Nov, 2016 1 commit
  18. 13 Oct, 2016 1 commit
  19. 12 Oct, 2016 1 commit
  20. 04 Jun, 2016 1 commit
  21. 12 Apr, 2016 1 commit
  22. 07 Nov, 2015 1 commit
    • Philip Withnall's avatar
      glib: Add missing (nullable) and (optional) annotations · 25a7c817
      Philip Withnall authored
      Add various (nullable) and (optional) annotations which were missing
      from a variety of functions. Also port a couple of existing (allow-none)
      annotations in the same files to use (nullable) and (optional) as
      appropriate instead.
      Secondly, add various (not nullable) annotations as needed by the new
      default in gobject-introspection of marking gpointers as (nullable). See
      This includes adding some stub documentation comments for the
      assertion macro error functions, which weren’t previously documented.
      The new comments are purely to allow for annotations, and hence are
      marked as (skip) to prevent the symbols appearing in the GIR file.
  23. 30 May, 2014 1 commit
  24. 20 Feb, 2014 2 commits
  25. 08 Feb, 2014 2 commits
  26. 06 Feb, 2014 4 commits
  27. 01 Feb, 2014 4 commits