summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bar.c7
-rw-r--r--src/group.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/bar.c b/src/bar.c
index 7ff0691..22ce0b5 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -397,9 +397,6 @@ get_mark_box (char *msg, int mark_start, int mark_end,
int start_line_beginning;
int end_line_beginning;
- if (mark_end == 0)
- return;
-
/* If the mark_end is on a new line or the end of the string, then
back it up one character. */
if (msg[mark_end-1] == '\n' || mark_end == strlen (msg))
@@ -480,6 +477,10 @@ draw_mark (rp_screen *s, char *msg, int mark_start, int mark_end)
{
int x, y, width, height;
+ /* when this happens, there is no mark. */
+ if (mark_end == 0 || mark_start == mark_end)
+ return;
+
get_mark_box (msg, mark_start, mark_end,
&x, &y, &width, &height);
draw_inverse_box (s, x, y, width, height);
diff --git a/src/group.c b/src/group.c
index 80ab89e..38b0fd3 100644
--- a/src/group.c
+++ b/src/group.c
@@ -443,6 +443,10 @@ groups_merge (rp_group *from, rp_group *to)
rp_window_elem *cur;
struct list_head *iter, *tmp;
+ /* Merging a group with itself makes no sense. */
+ if (from == to)
+ return;
+
/* Move the unmapped windows. */
list_for_each_safe_entry (cur, iter, tmp, &from->unmapped_windows, node)
{