nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 745410336b6d9c08357e11de2bbeb7d202731244
parent 71c9a5245a8bf676ca72c3d38c055f7bc33d86ae
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Tue, 13 May 2014 20:20:51 +0000

Condensing a function a bit.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4875 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 1+
Msrc/global.c | 7++-----
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -5,6 +5,7 @@ * src/global.c (thanks_for_all_the_fish): Upon exit also free the lists with functions and shortcuts. * src/*.c: Several random whitespace and comment tweaks. + * src/global.c (replace_scs_for): Condense the function a bit. 2014-05-12 Benno Schulenberg <bensberg@justemail.net> * src/text.c (do_spell): Provide startup feedback, as for the linter. diff --git a/src/global.c b/src/global.c @@ -373,15 +373,12 @@ void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggl #endif } -/* Assign one menu's shortcuts to another function. */ +/* Assign one function's shortcuts to another function. */ void replace_scs_for(void (*oldfunc)(void), void (*newfunc)(void)) { sc *s; - if (sclist == NULL) - return; - - for (s = sclist; s->next != NULL; s = s->next) + for (s = sclist; s != NULL; s = s->next) if (s->scfunc == oldfunc) { s->scfunc = newfunc; }