utils: Fix nul termination of xdg_app_spawn output

The terminating zero byte was written after the output stream
was closed, so it never got added to the string.
tingping/wmclass
Alexander Larsson 2016-01-28 16:20:22 +01:00
parent 96d9204f86
commit a12bb89c9c
1 changed files with 2 additions and 1 deletions

View File

@ -1213,7 +1213,7 @@ xdg_app_spawn (GFile *dir,
out = g_memory_output_stream_new_resizable ();
g_output_stream_splice_async (out,
in,
G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
G_OUTPUT_STREAM_SPLICE_NONE,
0,
NULL,
spawn_output_spliced_cb,
@ -1241,6 +1241,7 @@ xdg_app_spawn (GFile *dir,
/* Null terminate */
g_output_stream_write (out, "\0", 1, NULL, NULL);
g_output_stream_close (out, NULL, NULL);
*output = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (out));
}