diff options
author | Josh Rahm <rahm@google.com> | 2022-07-21 15:53:59 -0600 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-07-21 15:53:59 -0600 |
commit | b11548e3db4361cd8312ffbd27472823bdab4d62 (patch) | |
tree | a84b5cf79fb41bb60b6495c1a346bb360b224604 /paste.c | |
parent | 88ebf5544e995d85b2f1416a216ac7f44f719eed (diff) | |
parent | ab1d18d00febe161080b8e81331861481110809f (diff) | |
download | rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.tar.gz rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.tar.bz2 rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.zip |
Merge remote-tracking branch 'origin/master' into rahm
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) |