diff options
author | Thomas Adam <thomas@xteddy.org> | 2022-06-04 10:01:09 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2022-06-04 10:01:09 +0100 |
commit | afb3a5fe7180f73457346cf12d096497d93aa642 (patch) | |
tree | 115ee9190ae9ff5af5358fdc0ee1662380145aed /paste.c | |
parent | e77e11ec6bad1207ab15ee0f148b6a084d9f091c (diff) | |
parent | 020c403dff56269d93625970ed41761520afc853 (diff) | |
download | rtmux-afb3a5fe7180f73457346cf12d096497d93aa642.tar.gz rtmux-afb3a5fe7180f73457346cf12d096497d93aa642.tar.bz2 rtmux-afb3a5fe7180f73457346cf12d096497d93aa642.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'paste.c')
-rw-r--r-- | paste.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -111,6 +111,12 @@ paste_walk(struct paste_buffer *pb) return (RB_NEXT(paste_time_tree, &paste_by_time, pb)); } +int +paste_is_empty(void) +{ + return RB_ROOT(&paste_by_time) == NULL; +} + /* Get the most recent automatic buffer. */ struct paste_buffer * paste_get_top(const char **name) @@ -118,6 +124,8 @@ paste_get_top(const char **name) struct paste_buffer *pb; pb = RB_MIN(paste_time_tree, &paste_by_time); + while (pb != NULL && !pb->automatic) + pb = RB_NEXT(paste_time_tree, &paste_by_time, pb); if (pb == NULL) return (NULL); if (name != NULL) |