Too many changes and fixes to mention them all here

This commit is contained in:
ceriel
1990-10-11 08:42:07 +00:00
parent 0232695ebe
commit 2d5497513a
23 changed files with 942 additions and 426 deletions

View File

@@ -13,6 +13,7 @@ extern char *dirs[];
extern FILE *fopen();
extern FILE *db_out;
extern t_lineno currline;
extern int interrupted;
static int
mk_filnm(dir, file, newname)
@@ -81,16 +82,14 @@ lines(file, l1, l2)
else f = last_f;
if (l1 < 1) l1 = 1;
if (l2 > file->f_nlines) l2 = file->f_nlines;
if (l1 > l2) {
error("%s has only %d lines", file->f_sym->sy_idf->id_text, file->f_nlines);
return;
}
if (l1 > file->f_nlines) l1 = file->f_nlines;
if (l1+l2-1 > file->f_nlines) l2 = file->f_nlines - l1 + 1;
fseek(f, *(file->f_linepos+(l1-1)), 0);
for (n = l1; n <= l2; n++) {
for (n = l1; n < l1 + l2; n++) {
register int c;
if (interrupted) return;
fprintf(db_out, "%c%5d\t", currfile && file == currfile->sy_file && n == currline ? '>' : ' ', n);
do {
c = getc(f);