Skip to content

utils: Always return non-NULL from _srt_recursive_list_content()

Simon McVittie requested to merge wip/smcv/recursive-list into main
  • utils: Always return non-NULL from _srt_recursive_list_content()

    Previously the result when the directory didn't exist was not guaranteed by the GPtrArray documentation: it could either be NULL (which would be OK) or a non-terminated array of 0 entries (which would lead to a segmentation fault in the caller). In practice it seems to have been reasonably reliably NULL, but let's make this predictable, by always returning a non-NULL (but possibly empty) GStrv.

    The practical result is that before, _srt_recursive_list_content(..., "/nonexistent") would return NULL, but now it returns (const char[]) { NULL }.

  • tests: Add coverage for _srt_recursive_list_content()


Enabler for !506 (merged), and possibly a bug fix for steam-runtime-system-info when upgrading GLib.

Merge request reports

Loading