putchar('\n');
}
+static int ws_read(void)
+{
+ int ws = 0;
+ for (;;) {
+ int c = getchar();
+ if (c < 0)
+ return !!fields_count(&in_fields);
+ if (c == '\r')
+ continue;
+ if (c == '\n')
+ return 1;
+ if (c == ' ' || c == '\t' || c == '\f') {
+ ensure_field();
+ if (!ws)
+ new_field();
+ ws++;
+ } else {
+ ensure_field();
+ *line_push(&in_line) = c;
+ in_field->len++;
+ ws = 0;
+ }
+ }
+}
+
/*** Field selection ***/
struct selector {
f->write_line = csv_write;
break;
case FORM_WS:
+ f->fs = ' ';
+ f->quote = -1;
+ f->read_line = ws_read;
+ f->write_line = csv_write;
break;
}