commit 756455b498ad80dcf42b8757d2949891fe7de310
parent 2b85fd14f3f4f38c4e90bd53a60fbe8e17a7be7e
Author: Louis Burda <quent.burda@gmail.com>
Date: Tue, 29 Sep 2020 12:05:56 +0200
Reverse patch and cleanup contrib files
Diffstat:
5 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/contrib/event.diff b/contrib/event.diff
@@ -1,7 +1,5 @@
-diff --git a/blocks.def.h b/blocks.def.h
-index 25c6f83..2bdb418 100644
---- a/blocks.def.h
-+++ b/blocks.def.h
+--- blocks.def.h
++++ blocks.def.h
@@ -1,6 +1,6 @@
#define SCRIPT_DIR(x) "/opt/wmsl-scripts/" x
@@ -10,10 +8,9 @@ index 25c6f83..2bdb418 100644
struct block blocks[] = {
/* command block-id interval flags */
-diff --git a/wmsl.c b/wmsl.c
-index 8f0d0fd..6a323b9 100644
---- a/wmsl.c
-+++ b/wmsl.c
+
+--- wmsl.c
++++ wmsl.c
@@ -13,9 +13,10 @@
#define OUTPUTMAX 256
#define STATUSMAX 1024
diff --git a/contrib/prefix-suffix.diff b/contrib/prefix-suffix.diff
@@ -1,7 +1,5 @@
-diff --git a/wmsl.c b/wmsl.c
-index 8f0d0fd..c2ec6e6 100644
---- a/wmsl.c
-+++ b/wmsl.c
+--- wmsl.c
++++ wmsl.c
@@ -22,6 +22,7 @@ struct block {
const char *command;
unsigned int id, sleep_max;
diff --git a/wmsl.c b/wmsl.c
@@ -22,7 +22,6 @@ struct block {
const char *command;
unsigned int id, sleep_max;
int flags;
- const char *prefix, *suffix;
float sleep_left;
char output[OUTPUTMAX];
};
@@ -136,11 +135,7 @@ update_blocks()
if (output_len) {
if (status_len > 0)
concat_status(delim, ARRSIZE(delim) - 1);
- if (blocks[i].prefix)
- concat_status(blocks[i].prefix, strlen(blocks[i].prefix));
concat_status(blocks[i].output, output_len);
- if (blocks[i].suffix)
- concat_status(blocks[i].suffix, strlen(blocks[i].suffix));
}
}
if (!update) return;
diff --git a/wmsl.c b/wmsl.c.orig
diff --git a/wmsl.c.rej b/wmsl.c.rej
@@ -0,0 +1,22 @@
+--- wmsl.c
++++ wmsl.c
+@@ -22,6 +22,7 @@ struct block {
+ const char *command;
+ unsigned int id, sleep_max;
+ int flags;
++ const char *prefix, *suffix;
+ float sleep_left;
+ char output[OUTPUTMAX];
+ };
+@@ -135,7 +136,11 @@ update_blocks()
+ if (output_len) {
+ if (status_len > 0)
+ concat_status(delim, ARRSIZE(delim) - 1);
++ if (blocks[i].prefix)
++ concat_status(blocks[i].prefix, strlen(blocks[i].prefix));
+ concat_status(blocks[i].output, output_len);
++ if (blocks[i].suffix)
++ concat_status(blocks[i].suffix, strlen(blocks[i].suffix));
+ }
+ }
+ if (!update) return;