On Thu, 4 Dec 2014 13:23:57 +0200 Pekka Paalanen <ppaala...@gmail.com> wrote:
> On Tue, 02 Dec 2014 12:12:28 -0800 > Bill Spitzak <spit...@gmail.com> wrote: > > > On 12/02/2014 05:45 AM, Pekka Paalanen wrote: > > > From: Pekka Paalanen <pekka.paala...@collabora.co.uk> > > > > > + if (!s->get_label || s->get_label(s, d, sizeof(d)) < 0) { > > > + d[0] = '\0'; > > > + q = ""; > > > + } > > > + > > > + fprintf(ctx->out, "{ \"id\":%u, " > > > + "\"type\":\"weston_surface\", " > > > + "\"desc\":%s%s%s%s }\n", > > > + s->timeline.id, q, d[0] ? d : "null", q, mainstr); > > > > I think you should make an emit(FILE*, const char*) function that prints > > a quoted string or null, instead of doing this repeatedly. Such a > > function could also convert non-printable characters to escape sequences. > > Yeah, not a bad idea. Just did the simplification, and pushed these two patches. It will break the JSON data if a window title contains unexpected characters, but that can be fixed later if it turns out to be a problem. Thanks, pq _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel