commit c23c38f4c93e5a386469a52a5874e402fe25b7b8
parent 36443394896a5ed94fa7d8dfdb45066a476dd99e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 24 Oct 2014 21:40:02 +0000
small code-style improvement
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/sob.c b/sob.c
@@ -142,8 +142,7 @@ utfprevn(const char *s, size_t p, size_t n)
{
size_t i;
- for(i = 0; p > 0; p--) {
- i++;
+ for(i = 1; p > 0; p--, i++) {
if(ISUTF8(s[p - 1]) && !--n)
return i;
}
@@ -157,8 +156,7 @@ utfnextn(const char *s, size_t p, size_t n)
{
size_t i;
- for(i = 0; s[p]; p++) {
- i++;
+ for(i = 1; s[p]; p++, i++) {
if(ISUTF8(s[p + 1]) && !--n)
return i;
}
@@ -741,14 +739,17 @@ line_wordpipeto(char **cmd)
static void
sighandler(int signum)
{
- if(signum == SIGTERM) {
+ switch(signum) {
+ case SIGTERM:
isrunning = 0;
cleanup();
- } else if(signum == SIGWINCH) {
+ break;
+ case SIGWINCH:
clear();
gettermsize();
resize();
line_draw();
+ break;
}
}