| # | Line 946 | Line 946 | int n; | |
|---|---|---|
| 946 | quit(1); | |
| 947 | } | |
| 948 | } else if (n < viewnum) { /* rewind file */ | |
| 949 | + | if (viewnum == 1 && feof(viewfp)) |
| 950 | + | return(&curview); /* just one view */ |
| 951 | if (fseek(viewfp, 0L, 0) == EOF) { | |
| 952 | perror(vval(VIEWFILE)); | |
| 953 | quit(1); | |
| # | Line 955 | Line 957 | int n; | |
| 957 | } | |
| 958 | while (n > viewnum) { /* scan to desired view */ | |
| 959 | if (fgets(linebuf, sizeof(linebuf), viewfp) == NULL) | |
| 960 | < | return(NULL); |
| 960 | > | return(viewnum==1 ? &curview : NULL); |
| 961 | if (isview(linebuf) && sscanview(&curview, linebuf) > 0) | |
| 962 | viewnum++; | |
| 963 | } | |
| – | Removed lines |
| + | Added lines |
| < | Changed lines (old) |
| > | Changed lines (new) |