|
|
|
@ -218,20 +218,19 @@ updatestatus()
|
|
|
|
|
/* all blocks are empty */
|
|
|
|
|
if (!current->pathu)
|
|
|
|
|
return 0;
|
|
|
|
|
/* contents of the current block just changed */
|
|
|
|
|
/* contents of the current block changed */
|
|
|
|
|
if (*current->cmdoutcur != *current->cmdoutprv)
|
|
|
|
|
goto update0;
|
|
|
|
|
/* no delimiter before the first non-empty block */
|
|
|
|
|
/* skip delimiter handler for the first non-empty block */
|
|
|
|
|
if (*current->cmdoutcur != '\n' && *current->cmdoutcur != '\0')
|
|
|
|
|
goto skipdelimc;
|
|
|
|
|
}
|
|
|
|
|
/* main loop */
|
|
|
|
|
for (; current->pathu; current++) {
|
|
|
|
|
/* contents of the current block just changed */
|
|
|
|
|
/* contents of the current block changed */
|
|
|
|
|
if (*current->cmdoutcur != *current->cmdoutprv)
|
|
|
|
|
goto update1;
|
|
|
|
|
/* delimiter handler */
|
|
|
|
|
/* current block is non-empty */
|
|
|
|
|
if (*current->cmdoutcur != '\n' && *current->cmdoutcur != '\0')
|
|
|
|
|
s += delimlength;
|
|
|
|
|
/* skip over empty blocks */
|
|
|
|
@ -241,7 +240,7 @@ skipdelimc:
|
|
|
|
|
/* checking for the first byte has been done */
|
|
|
|
|
c = current->cmdoutcur + 1, p = current->cmdoutprv + 1;
|
|
|
|
|
for (; *c != '\n' && *c != '\0'; c++, p++)
|
|
|
|
|
/* contents of the current block just changed */
|
|
|
|
|
/* contents of the current block changed */
|
|
|
|
|
if (*c != *p) {
|
|
|
|
|
s += c - current->cmdoutcur;
|
|
|
|
|
goto update2;
|
|
|
|
@ -260,7 +259,7 @@ skipdelimc:
|
|
|
|
|
if (!current->pathu)
|
|
|
|
|
return 1;
|
|
|
|
|
update0:
|
|
|
|
|
/* skip delimiter before the first non-empty block */
|
|
|
|
|
/* don't add delimiter before the first non-empty block */
|
|
|
|
|
if (*current->cmdoutcur != '\n' && *current->cmdoutcur != '\0')
|
|
|
|
|
goto skipdelimu;
|
|
|
|
|
*current->cmdoutprv = *current->cmdoutcur;
|
|
|
|
@ -269,7 +268,6 @@ update0:
|
|
|
|
|
for (; current->pathu; current++) {
|
|
|
|
|
update1:
|
|
|
|
|
/* delimiter handler */
|
|
|
|
|
/* current block is non-empty */
|
|
|
|
|
if (*current->cmdoutcur != '\n' && *current->cmdoutcur != '\0') {
|
|
|
|
|
d = delim;
|
|
|
|
|
while (*d != '\0')
|
|
|
|
|