+ output = g_malloc0(raw_len + 1);
+
+ /* Copy the string without any unwanted newlines. */
+ raw_idx = idx = 0;
+ while (raw_idx < raw_len) {
+ if (raw_output[raw_idx] != '\n') {
+ output[idx] = raw_output[raw_idx];
+ idx++;
+ }
+ raw_idx++;
+ }
+
+ g_fprintf(stderr, "%s\n", output);
+ fflush(stderr);
+ g_free(raw_output);
+ g_free(output);
+