Skip to content

Commit 59dcc28

Browse files
committed
fix export for non tabular data
1 parent fa40515 commit 59dcc28

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/export.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,20 +309,31 @@ next_char(FmtLineIter *iter,
309309
{
310310
char *result = iter->row;
311311

312-
if (!iter->row || !iter->headline)
312+
if (!iter->row)
313313
return NULL;
314314

315-
if (*iter->row == '\0' || *iter->headline == '\n')
315+
if (*result == '\0')
316316
return NULL;
317317

318-
*typ = *(iter->headline);
319-
*xpos = iter->xpos;
318+
if (iter->headline && *iter->headline == '\n')
319+
return NULL;
320320

321321
*size = charlen(result);
322322
*width = dsplen(result);
323+
*xpos = iter->xpos;
324+
325+
if (iter->headline)
326+
{
327+
*typ = *(iter->headline);
328+
iter->headline += *width;
329+
}
330+
else
331+
{
332+
/* content of plain text can be only of data format */
333+
*typ = 'd';
334+
}
323335

324336
iter->row += *size;
325-
iter->headline += *width;
326337
iter->xpos += *width;
327338

328339
return result;

src/pspg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,9 @@ extern FILE *logfile;
499499
/*
500500
* REMOVE THIS COMMENT FOR DEBUG OUTPUT
501501
* and modify a path.
502-
*
503-
#define DEBUG_PIPE "/home/pavel/debug"
504502
*/
503+
#define DEBUG_PIPE "/home/pavel/debug"
504+
505505

506506
#ifdef DEBUG_PIPE
507507

0 commit comments

Comments
 (0)