summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-10-17 16:36:35 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-10-17 16:37:04 -0400
commit2064e071b09946c58b8c5ec4dd66a8813a10b4c8 (patch)
tree0ace3e18e0530eadbccb5dab0f759bfa055bebc1 /test
parent9fd217fc95eda803feaf0ba97f2231870e0111f1 (diff)
downloadcups-2064e071b09946c58b8c5ec4dd66a8813a10b4c8.tar.gz
Save/restore line number to fix error line reporting.
Diffstat (limited to 'test')
-rw-r--r--test/ipptool.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/ipptool.c b/test/ipptool.c
index 1e59fa96e..cf919b303 100644
--- a/test/ipptool.c
+++ b/test/ipptool.c
@@ -3786,6 +3786,7 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */
!_cups_strcasecmp(token, "WITH-VALUE"))
{
off_t lastpos; /* Last file position */
+ int lastline; /* Last line number */
if (data->last_expect)
{
@@ -3815,8 +3816,9 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */
for (;;)
{
- lastpos = cupsFileTell(f->fp);
- ptr += strlen(ptr);
+ lastpos = cupsFileTell(f->fp);
+ lastline = f->linenum;
+ ptr += strlen(ptr);
if (!_ippFileReadToken(f, ptr, (sizeof(temp) - (size_t)(ptr - temp))))
break;
@@ -3839,6 +3841,7 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */
*/
cupsFileSeek(f->fp, lastpos);
+ f->linenum = lastline;
*ptr = '\0';
break;
}