From: Valeriu Ohan Date: Thu, 4 Jan 2018 13:00:02 +0000 (+0000) Subject: Fixes the finished flag. X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=efd09f0a00e35f85b4065e30c210110fdfb0f225;p=klib.git Fixes the finished flag. --- diff --git a/kstring.c b/kstring.c index 253d281..3e0b642 100644 --- a/kstring.c +++ b/kstring.c @@ -38,7 +38,7 @@ char *kstrtok(const char *str, const char *sep, ks_tokaux_t *aux) { const char *p, *start; if (sep) { // set up the table - if (str == 0 && (aux->tab[0]&1)) return 0; // no need to set up if we have finished + if (str == 0 && aux->finished) return 0; // no need to set up if we have finished aux->finished = 0; if (sep[1]) { aux->sep = -1;