If we aren't looking for an exact addr vs. line match in findline(), and
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Wed, 19 Feb 1986 18:12:58 +0000 (10:12 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Wed, 19 Feb 1986 18:12:58 +0000 (10:12 -0800)
the addr is before the first source addr, let's assume it's legit and
return the first source line.  This prevents the obnoxious 'second number
must be greater than first' message after 'func foo; list' and function foo
is the first function in the file.

SCCS-vsn: old/dbx/mappings.c 5.2

usr/src/old/dbx/mappings.c

index 9e05570..e6eca8b 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mappings.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)mappings.c 5.2 (Berkeley) %G%";
 #endif not lint
 
 static char rcsid[] = "$Header: mappings.c,v 1.4 84/12/26 10:40:25 linton Exp $";
 #endif not lint
 
 static char rcsid[] = "$Header: mappings.c,v 1.4 84/12/26 10:40:25 linton Exp $";
@@ -101,8 +101,10 @@ Boolean exact;
     register Lineno r;
     register Address a;
 
     register Lineno r;
     register Address a;
 
-    if (nlhdr.nlines == 0 or addr < linetab[0].addr) {
+    if (nlhdr.nlines == 0) {
        r = -1;
        r = -1;
+    } else if (addr < linetab[0].addr) {
+       r = exact ? -1 : 0;
     } else {
        i = 0;
        j = nlhdr.nlines - 1;
     } else {
        i = 0;
        j = nlhdr.nlines - 1;