From 5bfbebe93fba98a3b5c1f64482823d53265aed5b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 23 Apr 2011 21:59:38 -0700 Subject: [PATCH] dissect-sysfile: Don't omit the last in a series of text tokens. Otherwise dissect-sysfile would not print the last long string variable name written by sys-file-writer, because it did not include a separator byte after the last record. (This was obvious running dissect-sysfile on a system file with only one variable.) --- tests/dissect-sysfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dissect-sysfile.c b/tests/dissect-sysfile.c index 444c15cc..7ae92bfc 100644 --- a/tests/dissect-sysfile.c +++ b/tests/dissect-sysfile.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1202,7 +1202,7 @@ text_tokenize (struct text_record *text, int delimiter) && text->buffer[text->pos] != delimiter && text->buffer[text->pos] != '\0') text->pos++; - if (text->pos == text->size) + if (start == text->pos) return NULL; text->buffer[text->pos++] = '\0'; return &text->buffer[start]; -- 2.30.2