circo

claudio's IRC oasis
git clone git://git.bitsmanent.org/circo
Log | Files | Refs | README | LICENSE

commit 6e81fb2482a8fa80c93e6376f96e9cfcbf4c7515
parent cd0926281fa31ecfd67599cd39f897324f72ac6c
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Wed, 26 Jul 2017 19:45:54 +0200

Rip cmd_close() some SLOC

Diffstat:
Mcirco.c | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/circo.c b/circo.c @@ -228,13 +228,7 @@ void cmd_close(char *cmd, char *s) { Buffer *b; - if(*s) { - b = getbuf(s); - } - else { - b = sel; - s = b->name; - } + b = *s ? getbuf(s) : sel; if(!b) { printb(status, "%s: unknown buffer.\n", s); return; @@ -243,8 +237,8 @@ cmd_close(char *cmd, char *s) { printb(status, "Cannot close the status.\n"); return; } - if(*s == '#' || *s == '&') - sout("PART :%s", s); + if(b->name[0] == '#' || b->name[0] == '&') + sout("PART :%s", b->name); if(b == sel) sel = sel->next ? sel->next : buffers; detach(b);