-
Simon McVittie authored
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 }`. Signed-off-by:
Simon McVittie <smcv@collabora.com>
Simon McVittie authoredPreviously 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 }`. Signed-off-by:
Simon McVittie <smcv@collabora.com>
system-info.c 141.45 KiB