Skip to content

strfuncs: add g_set_str()

Christian Hergert requested to merge wip/chergert/g_set_str into main

This is like our other suite of g_set_*() based APIs to simplify and improve correctness of setters for fields, properties, and more.

This implementation specifically handles setting string values that may point to an offset within the current string by copying before free.

strcmp() is used directly (as opposed to g_strcmp0() due to it being in gtestutils.h as well as to increase the chance that the compiler will hoist the implementation.

Fixes #2747 (closed)

Merge request reports

Loading