refactor: roster export uses GString and g_file_set_contents now

Modernize the /export command implementation by adopting GLib-based
patterns for string manipulation and file handling.

* Replace _writecsv with _append_csv_escaped to efficiently handle CSV
  quote doubling directly within a GString buffer
* Refactor cmd_export to build the CSV content in memory using GString,
  minimizing system calls
* Use g_file_set_contents for atomic writing
This commit is contained in:
Michael Vetter
2026-02-26 20:24:04 +01:00
parent 9f3d78a994
commit 5711671c99

View File

@@ -1074,7 +1074,6 @@ cmd_script(ProfWin* window, const char* const command, gchar** args)
return TRUE;
}
/* escape a string into csv and write it to the file descriptor */
static void
_append_csv_escaped(GString* buffer, const char* const str)
{