mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-12-17 10:23:21 +00:00
riverctl patch: fix some if statements that were terribly written at 11pm and actually properly free some data on error
This commit is contained in:
parent
fc5925e7b6
commit
fb576dd523
@ -1,4 +1,4 @@
|
|||||||
From 2a7a35b64d091bb85cff4180d48a510cf5a28522 Mon Sep 17 00:00:00 2001
|
From 2c699064c0d592e35a7316e546648b6f56cb6e9c Mon Sep 17 00:00:00 2001
|
||||||
From: Zuki Air <zukirust@gmail.com>
|
From: Zuki Air <zukirust@gmail.com>
|
||||||
Date: Sun, 27 Jul 2025 11:30:32 +0100
|
Date: Sun, 27 Jul 2025 11:30:32 +0100
|
||||||
Subject: [PATCH] river-ctl patch
|
Subject: [PATCH] river-ctl patch
|
||||||
@ -13,8 +13,8 @@ improve uint error handling
|
|||||||
dwl.c | 20 +-
|
dwl.c | 20 +-
|
||||||
dwlctl.c | 132 +++++
|
dwlctl.c | 132 +++++
|
||||||
protocols/river-control-unstable-v1.xml | 85 +++
|
protocols/river-control-unstable-v1.xml | 85 +++
|
||||||
river-control.h | 732 ++++++++++++++++++++++++
|
river-control.h | 744 ++++++++++++++++++++++++
|
||||||
7 files changed, 1012 insertions(+), 16 deletions(-)
|
7 files changed, 1024 insertions(+), 16 deletions(-)
|
||||||
create mode 100644 dwlctl.c
|
create mode 100644 dwlctl.c
|
||||||
create mode 100644 protocols/river-control-unstable-v1.xml
|
create mode 100644 protocols/river-control-unstable-v1.xml
|
||||||
create mode 100644 river-control.h
|
create mode 100644 river-control.h
|
||||||
@ -448,10 +448,10 @@ index 0000000..aa5fc4d
|
|||||||
+</protocol>
|
+</protocol>
|
||||||
diff --git a/river-control.h b/river-control.h
|
diff --git a/river-control.h b/river-control.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..9583607
|
index 0000000..07cd8fb
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/river-control.h
|
+++ b/river-control.h
|
||||||
@@ -0,0 +1,732 @@
|
@@ -0,0 +1,744 @@
|
||||||
+#include "river-control-unstable-v1-private-protocol.c"
|
+#include "river-control-unstable-v1-private-protocol.c"
|
||||||
+#include "river-control-unstable-v1-protocol.h"
|
+#include "river-control-unstable-v1-protocol.h"
|
||||||
+#ifdef KEYS_USED
|
+#ifdef KEYS_USED
|
||||||
@ -1054,9 +1054,15 @@ index 0000000..9583607
|
|||||||
+ } else if (strcmp("down",argument)) {
|
+ } else if (strcmp("down",argument)) {
|
||||||
+ arg->i = WLR_DIRECTION_DOWN;
|
+ arg->i = WLR_DIRECTION_DOWN;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (ZRIVER_ARG_TYPE_KEY) {
|
+ if (args->type == ZRIVER_ARG_TYPE_KEY) {
|
||||||
+ free(args->p.kl->key);
|
+ free(args->p.kl->key);
|
||||||
+ free(args->p.kl);
|
+ free(args->p.kl);
|
||||||
|
+ } else if (args->type == ZRIVER_ARG_TYPE_FUNC) {
|
||||||
|
+ if (args->str_link != NULL) {
|
||||||
|
+ free_str_store(args->str_link);
|
||||||
|
+ free(args->str_link);
|
||||||
|
+ }
|
||||||
|
+ free(args->p.fa);
|
||||||
+ }
|
+ }
|
||||||
+ args->error = true;
|
+ args->error = true;
|
||||||
+ args->error_msg = zriver_error_out_of_range;
|
+ args->error_msg = zriver_error_out_of_range;
|
||||||
@ -1064,12 +1070,18 @@ index 0000000..9583607
|
|||||||
+ break;
|
+ break;
|
||||||
+ case(FUNC_STR_ARG_TYPE_LAYOUT):
|
+ case(FUNC_STR_ARG_TYPE_LAYOUT):
|
||||||
+ arg->ui = strtol(argument,NULL,10);
|
+ arg->ui = strtol(argument,NULL,10);
|
||||||
+ if (arg->ui < LENGTH(layouts)) {
|
+ if (arg->ui < (int)LENGTH(layouts)) {
|
||||||
+ arg->v = &layouts[arg->ui];
|
+ arg->v = &layouts[arg->ui];
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (ZRIVER_ARG_TYPE_KEY) {
|
+ if (args->type == ZRIVER_ARG_TYPE_KEY) {
|
||||||
+ free(args->p.kl->key);
|
+ free(args->p.kl->key);
|
||||||
+ free(args->p.kl);
|
+ free(args->p.kl);
|
||||||
|
+ } else if (args->type == ZRIVER_ARG_TYPE_FUNC) {
|
||||||
|
+ if (args->str_link != NULL) {
|
||||||
|
+ free_str_store(args->str_link);
|
||||||
|
+ free(args->str_link);
|
||||||
|
+ }
|
||||||
|
+ free(args->p.fa);
|
||||||
+ }
|
+ }
|
||||||
+ args->error = true;
|
+ args->error = true;
|
||||||
+ args->error_msg = zriver_error_out_of_range;
|
+ args->error_msg = zriver_error_out_of_range;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user