diff --git a/blocks.h b/blocks.h index 57c0b73..41e7638 100644 --- a/blocks.h +++ b/blocks.h @@ -23,7 +23,6 @@ delivered first. */ /* pathu - path of the program whose output is used as status text of the block - (output of the program should end in a null or newline character) * pathc - path of the program used for handling clicks on the block */ /* 1 interval = INTERVALs seconds, INTERVALn nanoseconds */ diff --git a/blocks/battery.sh b/blocks/battery.sh index 6106114..df98fc8 100755 --- a/blocks/battery.sh +++ b/blocks/battery.sh @@ -1,4 +1,4 @@ #!/bin/sh ICON="  " read -r capacity curcmdout[block->curcmdout[trd - 1] == '\n' ? trd - 1 : trd] = '\0'; } } } @@ -249,7 +250,7 @@ updatestatus() /* checking half of the function */ for (; block->pathu; block++) { c = block->curcmdout, p = block->prvcmdout; - for (; *c == *p && *c != '\n' && *c != '\0'; c++, p++); + for (; *c != '\0' && *c == *p; c++, p++); s += c - block->curcmdout; if (*c != *p) goto update; @@ -265,7 +266,7 @@ updatestatus() for (; block->pathu; block++) { c = block->curcmdout, p = block->prvcmdout; update: - for (; *p = *c, *c != '\n' && *c != '\0'; c++, p++) + for (; (*p = *c) != '\0'; c++, p++) *(s++) = *c; if (c == block->curcmdout) continue;