diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-04-06 03:40:45 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-04-06 03:40:53 -0400 |
| commit | 711163a87326084a3344e5b6962a0c2ceaa16431 (patch) | |
| tree | 601ae1e462631f7a3162229c0a5bd6f528da616b | |
| parent | 7f571f805cb1bf7f7d20e65ac0ec9e0d70105e5a (diff) | |
| download | fujinet-chat-711163a87326084a3344e5b6962a0c2ceaa16431.tar.gz | |
Deduplicate code in get_cur_(nick,chan). 6722 bytes free.
| -rw-r--r-- | src/irc.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -800,22 +800,23 @@ static void hunt_screen(signed char dir) { scr_display(s); } -static char *get_cur_chan(void) { - if(scr_current == SCR_SERVER && last_chan[0]) - return last_chan; - else if ((scr_current > 1) && (scr_names[scr_current][0] == '#')) +static char *get_cur(void) { + if((scr_current > 1) && (scr_names[scr_current][0] == '#')) return scr_names[scr_current]; else return 0; } +static char *get_cur_chan(void) { + if(scr_current == SCR_SERVER && last_chan[0]) + return last_chan; + else return get_cur(); +} + static char *get_cur_nick(void) { if(scr_current == SCR_PRIV && last_pm_nick[0]) return last_pm_nick; - else if (scr_current > 1 && scr_names[scr_current][0] != '#') - return scr_names[scr_current]; - else - return 0; + else return get_cur(); } static void send2_with_space(char *s1, char *s2) { |
