Mercurial > hg > Members > kono > nitros9-code
annotate 3rdparty/packages/ed/getlst.c @ 994:bef1844de0dc
The ED editor ported from Minix
author | roug |
---|---|
date | Sun, 23 Feb 2003 21:11:37 +0000 |
parents | |
children |
rev | line source |
---|---|
994 | 1 /* getlst.c */ |
2 #include <stdio.h> | |
3 #include "tools.h" | |
4 #include "ed.h" | |
5 | |
6 int getlst() | |
7 { | |
8 int num; | |
9 | |
10 line2 = 0; | |
11 for (nlines = 0; (num = getone()) >= 0;) { | |
12 line1 = line2; | |
13 line2 = num; | |
14 nlines++; | |
15 if (*inptr != ',' && *inptr != ';') break; | |
16 if (*inptr == ';') curln = num; | |
17 inptr++; | |
18 } | |
19 nlines = min(nlines, 2); | |
20 if (nlines == 0) line2 = curln; | |
21 if (nlines <= 1) line1 = line2; | |
22 | |
23 if (num == ERR) | |
24 return(num); | |
25 else | |
26 return(nlines); | |
27 } | |
28 |