-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.c
960 lines (887 loc) · 18.7 KB
/
input.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
/* input.c */
/* Author:
* Steve Kirkendall
* 1500 SW Park #326
* Portland OR, 97201
*/
/* This file contains the input() function, which implements vi's INPUT mode.
* It also contains the code that supports digraphs.
*/
#include "config.h"
#include "ctype.h"
#include "vi.h"
#ifndef NO_DIGRAPH
static struct _DIG
{
struct _DIG *next;
char key1;
char key2;
char dig;
char save;
} *digs;
char digraph(key1, key2)
int key1; /* the underlying character */
int key2; /* the second character */
{
int newkey;
REG struct _DIG *dp;
/* if digraphs are disabled, then just return the new char */
if (!*o_digraph)
{
return key2;
}
/* remember the new key, so we can return it if this isn't a digraph */
newkey = key2;
/* sort key1 and key2, so that their original order won't matter */
if (key1 > key2)
{
key2 = key1;
key1 = newkey;
}
/* scan through the digraph chart */
for (dp = digs;
dp && (dp->key1 != key1 || dp->key2 != key2);
dp = dp->next)
{
}
/* if this combination isn't in there, just use the new key */
if (!dp)
{
return newkey;
}
/* else use the digraph key */
return dp->dig;
}
/* this function lists or defines digraphs */
void do_digraph(bang, extra)
int bang;
char extra[];
{
int dig;
REG struct _DIG *dp;
struct _DIG *prev;
static int user_defined = FALSE; /* boolean: are all later digraphs user-defined? */
char listbuf[8];
/* if "extra" is NULL, then we've reached the end of the built-ins */
if (!extra)
{
user_defined = TRUE;
return;
}
/* if no args, then display the existing digraphs */
if (*extra < ' ')
{
listbuf[0] = listbuf[1] = listbuf[2] = listbuf[5] = ' ';
listbuf[7] = '\0';
for (dig = 0, dp = digs; dp; dp = dp->next)
{
if (dp->save || bang)
{
dig += 7;
if (dig >= COLS)
{
addch('\n');
exrefresh();
dig = 7;
}
listbuf[3] = dp->key1;
listbuf[4] = dp->key2;
listbuf[6] = dp->dig;
qaddstr(listbuf);
}
}
addch('\n');
exrefresh();
return;
}
/* make sure we have at least two characters */
if (!extra[1])
{
msg("Digraphs must be composed of two characters");
return;
}
/* sort key1 and key2, so that their original order won't matter */
if (extra[0] > extra[1])
{
dig = extra[0];
extra[0] = extra[1];
extra[1] = dig;
}
/* locate the new digraph character */
for (dig = 2; extra[dig] == ' ' || extra[dig] == '\t'; dig++)
{
}
dig = extra[dig];
if (!bang && dig)
{
dig |= 0x80;
}
/* search for the digraph */
for (prev = (struct _DIG *)0, dp = digs;
dp && (dp->key1 != extra[0] || dp->key2 != extra[1]);
prev = dp, dp = dp->next)
{
}
/* deleting the digraph? */
if (!dig)
{
if (!dp)
{
#ifndef CRUNCH
msg("%c%c not a digraph", extra[0], extra[1]);
#endif
return;
}
if (prev)
prev->next = dp->next;
else
digs = dp->next;
_free_(dp);
return;
}
/* if necessary, create a new digraph struct for the new digraph */
if (dig && !dp)
{
dp = (struct _DIG *)malloc(sizeof *dp);
if (!dp)
{
msg("Out of space in the digraph table");
return;
}
if (prev)
prev->next = dp;
else
digs = dp;
dp->next = (struct _DIG *)0;
}
/* assign it the new digraph value */
dp->key1 = extra[0];
dp->key2 = extra[1];
dp->dig = dig;
dp->save = user_defined;
}
# ifndef NO_MKEXRC
void savedigs(fd)
int fd;
{
static char buf[] = "digraph! XX Y\n";
REG struct _DIG *dp;
for (dp = digs; dp; dp = dp->next)
{
if (dp->save)
{
buf[9] = dp->key1;
buf[10] = dp->key2;
buf[12] = dp->dig;
write(fd, buf, (unsigned)14);
}
}
}
# endif
#endif
/* This function allows the user to replace an existing (possibly zero-length)
* chunk of text with typed-in text. It returns the MARK of the last character
* that the user typed in.
*/
MARK input(from, to, when, delta)
MARK from; /* where to start inserting text */
MARK to; /* extent of text to delete */
int when; /* either WHEN_VIINP or WHEN_VIREP */
int delta; /* 1 to take indent from lower line, -1 for upper, 0 for none */
{
unsigned char key[3]; /* key char followed by '\0' char */
unsigned char keyTemp[2]; /* Hangul 1st byte followed by '\0'*/
/* for v_subst() with Hangul input */
int nByteInput;
char *build; /* used in building a newline+indent string */
char *scan; /* used while looking at the indent chars of a line */
MARK m; /* some place in the text */
#ifndef NO_EXTENSIONS
int quit = FALSE; /* boolean: are we exiting after this? */
int inchg; /* boolean: have we done a "beforedo()" yet? */
#endif
#ifdef DEBUG
/* if "from" and "to" are reversed, complain */
if (from > to)
{
msg("ERROR: input(%ld:%d, %ld:%d)",
markline(from), markidx(from),
markline(to), markidx(to));
return MARK_UNSET;
}
#endif
key[2] = 0;
keyTemp[1] = 0;
/* if we're replacing text with new text, save the old stuff */
/* (Alas, there is no easy way to save text for replace mode) */
if (from != to)
{
cut(from, to);
}
/* if doing a dot command, then reuse the previous text */
if (doingdot)
{
ChangeText
{
/* delete the text that's there now */
if (from != to)
{
delete(from, to);
}
/* insert the previous text */
cutname('.');
cursor = paste(from, FALSE, TRUE) + 1L;
}
}
else /* interactive version */
{
int addspace = 0;
/* assume that whoever called this already did a beforedo() */
#ifndef NO_EXTENSIONS
inchg = TRUE;
#endif
/* if doing a change within the line... */
if (from != to && markline(from) == markline(to))
{
/* mark the end of the text with a "$" */
pfetch(markline(to-1));
if (IsHIdx(ptext, markidx(to-1)) == HAN_SECOND)
{
change(to - 2, to, " $");
}
else
{
change(to - 1, to, "$");
}
}
else
{
/* delete the old text right off */
if (from != to)
{
delete(from, to);
}
to = from;
}
/* handle autoindent of the first line, maybe */
cursor = from;
m = cursor + MARK_AT_LINE(delta);
if (delta != 0 && *o_autoindent && markidx(m) == 0
&& markline(m) >= 1L && markline(m) <= nlines)
{
/* Only autoindent blank lines. */
pfetch(markline(cursor));
if (plen == 0)
{
/* Okay, we really want to autoindent */
pfetch(markline(m));
for (scan = ptext, build = tmpblk.c;
*scan == ' ' || *scan == '\t';
)
{
*build++ = *scan++;
}
if (build > tmpblk.c)
{
*build = '\0';
add(cursor, tmpblk.c);
cursor += (int)(build - tmpblk.c);
if (cursor > to)
to = cursor;
}
}
}
/* repeatedly add characters from the user */
nByteInput = 0;
for (;;)
{
/* Get a character */
redraw(cursor, TRUE);
#ifdef DEBUG2
msg("cursor=%ld.%d, to=%ld.%d",
markline(cursor), markidx(cursor),
markline(to), markidx(to));
#endif
#ifndef NO_ABBR
pfetch(markline(cursor));
build = ptext;
if (pline == markline(from))
build += markidx(from);
for (scan = ptext + markidx(cursor); --scan >= build && !isspace(*scan); )
{
}
scan++;
key[0] = getabkey(when, ptext, markidx(cursor));
if (IsHiBitOn( key[0] ))
{
key[1] = getabkey(when, scan, (int)(ptext + markidx(cursor) - scan));
nByteInput = 2;
}
else
{
key[1] = 0;
nByteInput = 1;
}
#else
key[0] = getkey(when);
if (IsHiBitOn( key[0] ))
{
key[1] = getkey(when);
nByteInput = 2;
}
else
{
key[1] = 0;
nByteInput = 1;
}
#endif
#ifndef NO_VISIBLE
if (key[0] != ctrl('O') && V_from != MARK_UNSET)
{
msg("Can't modify text during a selection");
beep();
continue;
}
#endif
#ifndef NO_EXTENSIONS
if (key[0] == ctrl('O'))
{
if (inchg)
{
if (cursor < to)
{
delete(cursor, to);
redraw(cursor, TRUE);
}
afterdo();
inchg = FALSE;
}
}
else if (key[0] != ctrl('['))
{
if (!inchg)
{
beforedo(FALSE);
inchg = TRUE;
}
}
#endif
#ifndef CRUNCH
/* if wrapmargin is set & we're past the
* warpmargin, then change the last whitespace
* characters on line into a newline
*/
if (*o_wrapmargin)
{
pfetch(markline(cursor));
if (!ptext[markidx(cursor)]
&& idx2col(cursor, ptext, TRUE) > COLS - (*o_wrapmargin & 0xff))
{
build = tmpblk.c;
*build++ = '\n';
if (*o_autoindent)
{
/* figure out indent for next line */
for (scan = ptext; *scan == ' ' || *scan == '\t'; )
{
*build++ = *scan++;
}
}
*build = '\0';
scan = ptext + plen;
m = cursor & ~(BLKSIZE - 1);
while (ptext < scan)
{
scan--;
if (*scan != ' ' && *scan != '\t')
continue;
/*break up line, and we do autoindent if needed*/
change(m + (int)(scan - ptext), m + (int)(scan - ptext) + 1, tmpblk.c);
/* NOTE: for some reason, MSC 5.10 doesn't
* like for these lines to be combined!!!
*/
cursor = (cursor & ~(BLKSIZE - 1));
cursor += BLKSIZE;
cursor += strlen(tmpblk.c) - 1;
cursor += plen - (int)(scan - ptext) - 1;
/*remove trailing spaces on previous line*/
pfetch(markline(m));
scan = ptext + plen;
while (ptext < scan)
{
scan--;
if (*scan != ' ' && *scan != '\t')
break;
}
delete(m + (int)(scan - ptext) + 1, m + plen);
break;
}
}
}
#endif /* !CRUNCH */
/* process it */
switch (*key)
{
#ifndef NO_EXTENSIONS
case ctrl('O'): /* special movement mapped keys */
*key = getkey(0);
switch (*key)
{
case 'h': m = m_left(cursor, 0L); break;
case 'j':
case 'k': m = m_updnto(cursor, 0L, *key); break;
case 'l': m = cursor + 1;
if (IsHiBitOnMark(cursor))
m++;
break;
case 'B':
case 'b': m = m_bword(cursor, 0L, *key); break;
case 'W':
case 'w': m = m_fword(cursor, 0L, *key, '\0'); break;
case '^': m = m_front(cursor, 0L); break;
case '$': m = m_rear(cursor, 0L); break;
case ctrl('B'):
case ctrl('F'):
m = m_scroll(cursor, 0L, *key); break;
case 'x':
#ifndef NO_VISIBLE
if (V_from)
beep();
else
#endif
ChangeText
{
m = v_xchar(cursor, 0L, 'x');
}
break;
case 'i': m = to = from = cursor;
when = WHEN_VIINP + WHEN_VIREP - when;
break;
case 'K':
pfetch(markline(cursor));
changes++; /* <- after this, we can alter ptext */
ptext[markidx(cursor)] = 0;
for (scan = ptext + markidx(cursor) - 1;
scan >= ptext && isalnum(*scan);
scan--)
{
}
scan++;
m = (*scan ? v_keyword(scan, cursor, 0L) : cursor);
break;
# ifndef NO_VISIBLE
case 'v':
case 'V':
if (V_from)
V_from = MARK_UNSET;
else
V_from = cursor;
m = from = to = cursor;
V_linemd = (*key == 'V');
break;
case 'd':
case 'y':
case '\\':
/* do nothing if unmarked */
if (!V_from)
{
msg("You must mark the text first");
beep();
break;
}
/* "from" must come before "to" */
if (V_from < cursor)
{
from = V_from;
to = cursor;
}
else
{
from = cursor;
to = V_from;
}
/* we don't need V_from anymore */
V_from = MARK_UNSET;
if (V_linemd)
{
/* adjust for line mode */
from &= ~(BLKSIZE - 1);
to |= (BLKSIZE - 1);
}
else
{
/* in character mode, we must
* worry about deleting the newline
* at the end of the last line
*/
pfetch(markline(to));
if (markidx(to) == plen)
to |= (BLKSIZE - 1);
}
to++;
switch (*key)
{
case 'y':
cut(from, to);
break;
case 'd':
ChangeText
{
cut(from, to);
delete(from, to);
}
cursor = from;
break;
#ifndef NO_POPUP
case '\\':
ChangeText
{
cursor = v_popup(from, to);
}
break;
#endif
}
m = from = to = cursor;
break;
case 'p':
case 'P':
V_from = MARK_UNSET;
ChangeText
{
m = paste(cursor, (*key == 'p'), FALSE);
}
break;
# endif /* !NO_VISIBLE */
default: m = MARK_UNSET;
}
/* adjust the moved cursor */
if (m != cursor)
{
m = adjmove(cursor, m, (*key == 'j' || *key == 'k' ? NCOL|FINL|INPM : FINL|INPM));
#if 0 /*!!!*/
if (plen && (*key == '$' || (*key == 'l' && m <= cursor)))
{
m++;
}
#endif
}
/* if the cursor is reasonable, use it */
if (m == MARK_UNSET)
{
beep();
}
else
{
from = to = cursor = m;
}
break;
case ctrl('Z'):
if (getkey(0) == ctrl('Z'))
{
quit = TRUE;
goto BreakBreak;
}
break;
#endif
case ctrl('['):
/* if last line contains only whitespace, then remove whitespace */
if (*o_autoindent)
{
pfetch(markline(cursor));
for (scan = ptext; isspace(*scan); scan++)
{
}
if (scan > ptext && !*scan)
{
cursor &= ~(BLKSIZE - 1L);
if (to < cursor + plen)
{
to = cursor + plen;
}
}
}
goto BreakBreak;
case ctrl('U'):
if (markline(cursor) == markline(from))
{
cursor = from;
}
else
{
cursor &= ~(BLKSIZE - 1);
}
break;
case ctrl('D'):
case ctrl('T'):
if (to > cursor)
{
delete(cursor, to);
}
mark[27] = cursor;
cmd_shift(cursor, cursor, *key == ctrl('D') ? CMD_SHIFTL : CMD_SHIFTR, TRUE, "");
if (mark[27])
{
cursor = mark[27];
}
else
{
cursor = m_front(cursor, 0L);
}
to = cursor;
break;
case '\b':
if (cursor <= from)
{
beep();
}
else if (markidx(cursor) == 0)
{
cursor -= BLKSIZE;
pfetch(markline(cursor));
cursor += plen;
}
else
{
cursor = m_left(cursor, 1L);
}
break;
case ctrl('W'):
m = m_bword(cursor, 1L, 'b');
if (markline(m) == markline(cursor) && m >= from)
{
cursor = m;
if (from > cursor)
{
from = cursor;
}
}
else
{
beep();
}
break;
case '\n':
#if OSK
case '\l':
#else
case '\r':
#endif
build = tmpblk.c;
*build++ = '\n';
if (*o_autoindent)
{
/* figure out indent for next line */
pfetch(markline(cursor));
for (scan = ptext; *scan == ' ' || *scan == '\t'; )
{
*build++ = *scan++;
}
/* remove indent from this line, if blank */
if ((int)(scan - ptext) == markidx(cursor) && plen > 0)
{
to = cursor &= ~(BLKSIZE - 1);
#if 1
delete(cursor, cursor + (int)(scan - ptext));
#else
delete(cursor, cursor + plen);
#endif
}
#if 0
/* Advance "to" past whitespace at the cursor.
* This is done so that if we insert a newline
* before whitespace, we can delete that whitespace
* from the front of the new line when we add
* the carefully calculated indent string to it.
*/
if (to == cursor)
{
for (scan = ptext + markidx(cursor); *scan == ' ' || *scan == '\t'; scan++, to++)
{
}
}
#endif
}
*build = 0;
if (cursor >= to && when != WHEN_VIREP)
{
add(cursor, tmpblk.c);
}
else
{
change(cursor, to, tmpblk.c);
}
redraw(cursor, TRUE);
to = cursor = (cursor & ~(BLKSIZE - 1))
+ BLKSIZE
+ (int)(build - tmpblk.c) - 1;
break;
case ctrl('A'):
case ctrl('P'):
if (cursor < to)
{
delete(cursor, to);
}
if (*key == ctrl('A'))
{
cutname('.');
}
m = paste(cursor, FALSE, TRUE);
if (m != MARK_UNSET)
{
to = cursor = m + 1L;
}
break;
case ctrl('V'):
if (cursor >= to && when != WHEN_VIREP)
{
add(cursor, "^");
}
else
{
change(cursor, to, "^");
to = cursor + 1;
}
redraw(cursor, TRUE);
*key = getkey(0);
if (*key == '\n')
{
/* '\n' too hard to handle */
#if OSK
*key = '\l';
#else
*key = '\r';
#endif
}
change(cursor, cursor + 1, key);
cursor++;
if (cursor > to)
{
to = cursor;
}
break;
case ctrl('L'):
case ctrl('R'):
redraw(MARK_UNSET, FALSE);
break;
default:
if (cursor >= to && when != WHEN_VIREP)
{
add(cursor, key);
cursor += nByteInput;
to = cursor;
}
else
{
pfetch(markline(cursor));
if (markidx(cursor) == plen)
{
add(cursor, key);
addspace = 0;
}
else
{
#ifndef NO_DIGRAPH
*key = digraph(ptext[markidx(cursor)], *key);
#endif
if (cursor + nByteInput < to || when == WHEN_VIREP)
{
if ((nByteInput == 1) && IsHiBitOnMark(cursor))
{ /* An ASC over 1st half of HANGUL */
change(cursor+1, cursor+2, " ");
addspace = 1;
}
else if ((nByteInput==2) && !IsHiBitOnMark(cursor) && IsHiBitOnMark(cursor+1))
{ /* an HANGUL over ASC+HANGUL */
change(cursor+2, cursor+3, " ");
addspace = 1;
}
else
{
addspace = 0;
}
change(cursor, cursor + nByteInput, key);
}
else if (cursor + nByteInput <= to )
{
change(cursor, cursor+nByteInput, key);
addspace = 0;
}
else
{ /* nByteInput crosses to */
keyTemp[0] = key[0];
change(cursor, cursor+1, keyTemp);
if (nByteInput == 2)
{ /* add 2nd byte */
add(cursor+1, &key[1]);
to++;
}
addspace = 0;
}
}
cursor += nByteInput;
}
#ifndef NO_SHOWMATCH
/* show matching "({[" if necessary */
if (*o_showmatch && strchr(")}]", *key))
{
redraw(cursor, TRUE);
m = m_match(cursor - 1, 0L);
if (markline(m) >= topline
&& markline(m) <= botline)
{
redraw(m, TRUE);
refresh();
sleep(1);
}
}
#endif
} /* end switch(*key) */
} /* end for(;;) */
BreakBreak:;
/* delete any excess characters */
if (cursor < to)
{
#ifndef NO_EXTENSIONS
/* if we aren't in the middle of a change, start one! */
if (!inchg)
{
beforedo(FALSE);
inchg = TRUE;
}
#endif
delete(cursor, to);
}
else if ((when == WHEN_VIREP) && addspace)
{
delete(cursor, cursor+1);
}
} /* end if doingdot else */
/* put the new text into a cut buffer for possible reuse */
if (!doingdot)
{
blksync();
cutname('.');
cut(from, cursor);
}
/* move to last char that we inputted, unless it was newline */
if (markidx(cursor) != 0)
{
cursor--;
pfetch(markline(cursor));
if (IsHIdx(ptext,markidx(cursor)) == HAN_SECOND)
cursor--;
}
redraw(cursor, FALSE);
#ifndef NO_EXTENSIONS
if (quit)
{
/* if this is a nested "do", then cut it short */
abortdo();
/* exit, unless we can't write out the file */
cursor = v_xit(cursor, 0L, 'Z');
}
#endif
rptlines = 0L;
return cursor;
}