Skip to content

Commit

Permalink
swaymsg: parse success of single object
Browse files Browse the repository at this point in the history
Allows swaymsg to parse the success attribute of a single object
response. This is needed for the subscribe event.
  • Loading branch information
RedSoxFan committed Nov 29, 2018
1 parent 9d18d81 commit e62ab6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swaymsg/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ static bool success_object(json_object *result) {
// Iterate results array and return false if any of them failed
static bool success(json_object *r, bool fallback) {
if (!json_object_is_type(r, json_type_array)) {
if (json_object_is_type(r, json_type_object)) {
return success_object(r);
}
return fallback;
}

Expand Down

0 comments on commit e62ab6d

Please sign in to comment.